[E-Lang] Syntax change: reducing side-effects

Mark S. Miller markm@caplet.com
Mon, 12 Feb 2001 08:15:46 -0800


At 07:50 AM Monday 2/12/01, Monty Zukowski wrote:
>Does E have any support for "#ifdef DEBUG" kinda stuff?

The same one Java does:

    if (DEBUG) { ... }

In other words, you just make DEBUG a normal runtime variable and switch on 
it.  If DEBUG in scope is defined as

in E:

    def DEBUG :final := false

or in Evar:

    def DEBUG := false

then eventually compilers should be able to optimize out the entire "if" 
statement as dead code.  Works for Java.  Keeps the semantics small and 
consistent.

Now that you bring it up, the E programmer could indeed use this trick to 
make all the  pre/post-condition,invariants,requires patterns I explained 
earlier explicitly switchable, negating my claim that Eiffel had a real 
advantage here.  Cool.


        Cheers,
        --MarkM