Forum OpenACS Development: Re: Language lawyering

Collapse
12: Re: Language lawyering (response to 1)
Posted by Don Baccus on
Oh, this is good to know, sounds like we shouldn't encourage use of "eq" until we switch over to AOLserver 4/Tcl 8.4 ...

And now I don't feel so stupid for not knowing about "eq" :)

It's a good thing we don't do much math in OpenACS, ain't it?  How confusing.  If you don't curly brace stuff the expression gets recompiled each time, as the quote above implies - I dug into the Tcl source just to make sure and yes, indeed, it's true.  It pushes the tokenized string and an EVAL bytecode op, and EVAL bytecompiles and executes the result.  If you bracket the bytecode itself is saved instead.

Which is why

if { ... }

is recommended even if the expression is a proc call.