Re: New keywords: ifdef, elsifdef, end ifdef

new topic     » goto parent     » topic index » view thread      » older message » newer message

Shawn Pringle wrote:
> 
> Jeremy Cowgar wrote:
> 
> > I like elsif better and it would reduce one keyword count, but I'm not sure
> > about it's clarity? Also, it would then blend in better with other standard
> > if/elsif/end if statements? Thinking aloud seeking input.
> 
> That sounds like optimization:
> 
> 
> Consider, in binding an executable that has the condition involving platform()
> comparing to a constant.  For the interpreter this is an expression that could
> 
> change from execution to execution, but for the program that makes the binary
> it will be a constant in the target executable.  So, it can optimize out the
> stuff that is for Windows if you are binding for a Linux program.
> 
> EUPHORIA expressions involving no functions always give you the same value if
> they contain only constants.  That can be the criteria for whether the binder
> should evaluate the expression itself and optimize accordingly.
> 
> Shawn Pringle

For most uses of ifdef and its ilk, the performance difference will be so small
as to be completely unnoticeable. I mean, you're not going to usually do an ifdef
around a critical loop.

Well, you might...

The main thing I see is that conditional interpretation can help version-proof
the language among other things.

If I am thinking correctly, anything that doesn't pass an ifdef test is
considered a comment by the interpreter and is discarded.

A small feature, but seemingly useful.

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu