Re: preprocessor
- Posted by Robert Craig <rds at RapidEuphoria.com> Oct 28, 2004
- 566 views
Tone Škoda wrote: > > Robert Craig wrote: > > The new 2.5 Translator will completely remove a block of code such as: > > }}} <eucode> > > if expr then > > ... > > -- lots of statements > > ... > > end if > > </eucode> {{{ > > whenever it can see at compile-time that > > expr always evaluates to 0 (FALSE). > > That looks good, I'll use it. > > I have a question: > > I use this: > > integer Debug > Debug = true > > global procedure assert (integer be_true) > if Debug then > if be_true = false then > ... tell user assert was called ... > end if > end if > end procedure > > I would prefer to use > > assert (length (smth) > length (smth_else)) > > than > > if Debug then > assert (length (smth) > length (smth_else)) > end if > > So, will translator also remove calls to routines which do nothing, like > assert() in > non-debug mode? assert's argument also slows things down because it has to be > evaluated. No, it currently won't remove calls to empty procedures. I'll add that to my list for 2.6. Thanks, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com