[lazarus] Win32 Installer/Lazarus

michael at tfdec1.fys.kuleuven.ac.be michael at tfdec1.fys.kuleuven.ac.be
Wed Jul 21 10:12:49 EDT 1999




On Wed, 21 Jul 1999, Peter Vreman wrote:

> > > Exact. But I am not sure whether the parser supports
> > > {$DEFINE DEBUG:=//}
> > > the // comment may confuse it. Has this been tested ?
> > 
> > It works like a charm here is how I set it up.
> > 
> > program test;
> > 
> > {$define DEBUGOUT:=//}
> > 
> > begin
> >    writeln('first line');
> >    DEBUGOUT ('*** debug line ***');
> >    writeln('last line');
> > end.
> > 
> > When done this way I only get the 2 writeln statements. When I changed
> > it to this.
> > 
> > program test;
> > 
> > {$define DEBUGOUT:=writeln}
> > 
> > begin
> >    writeln('first line');
> >    DEBUGOUT ('*** debug line ***');
> >    writeln('last line');
> > end.
> > 
> > I get all 3 lines. Works cool.
> > 
> > I had hoped I could do something like this.
> > 
> > {$define //DEBUGOUT:=writeln}
> > 
> > begin
> > .
> > .
> >    //DEBUGOUT ('debug text');
> > .
> > .
> > end.
> > 
> > This way if the macro wasn't defined or if -Sm was set it would just
> > take the line as a comment. Infortunately it doesn't appear that the
> > define statement can handle a macro named with leading '//' characters.
> > 
> > Hey compiler guys any chance that this is changable? That would make the
> > code really slick if it could be self commenting lines.
> Then we should also allow things like
> 
> {$define {:=hello}
> 
> Do you really want to make a mess with such macro's?
> 
> // is comment and is parsed like that. The macro's are only replaced after
> a identifier is read.

I agree with peter on this.

In any case, I think the possibility of using assert is better.

Michael.






More information about the Lazarus mailing list