[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: macros / code construction (and assignment)
Brook wrote:
> You can get 90% of 'if bool then else':
> if: bool Then: thenClause Else: elseClause =
> ( bool if: thenClause False: elseClause ).
Oh, OK. In this case, a macro would indeed be an efficiency hack. Because
using a message would give up locality there. Where is the `if:Then:Else:'
slot? In globalBehavior, I guess. And that slot takes time to find. If
its content is a normal method, it will be evaluated over and over again.
Maybe the compiler can optimize that away, but I don't think so.
If it instead explicitly transforms the code, and does that only once, the
boolean will again get to handle the message directly. This would have to
happen at `initialization time / block/method creation time'. But then a
syntactic context is necessary. *frown* Or the code could be modified when
it is first evaluated. *big frown*
Gee, I know too little in this area, I give in (for now ;-). Have to read
think some more there, especially about BETA and syntactic stuff in Scheme.
Your idea to reverse the capitalization is nice, I like it.
> Figure out some inference rule to get rid of the colons, then figure
> out another one to allow white space in names and you're really
> cooking....
The result looks tempting, but rules like that can and will _really_ bite
you is my guess. :-(
Rainer