thisCompiler special variable

Jerry Jackson jrj at channelpoint.com
Thu May 18 14:58:24 UTC 2000



> -----Original Message-----
> From: Stephen Pair [mailto:spair at advantive.com]
> Sent: Thursday, May 18, 2000 12:58 AM
> To: Squeak
> Subject: thisCompiler special variable
> 
> 
> I've always wanted a way of specifying compile time 
> directives in method
> source.  I just had a thought that it might be nice to expose 
> a new special
> variable called "thisCompiler" (or maybe thisParser?).
> 

I like this idea.  It's strongly reminiscent of "[...]" in FORTH
and compile-time eval in Lisp.  I think it would be worthwhile just for
debugging even if it didn't have other uses.  Being able to create
complicated "literals" at compile-time is great as well.  You could even
base assertions on this and have multiple levels of debug --

thisCompiler ifDebugLevelAtLeast: 3 include: [...].

assert: [...] could be equivalent to ifDebugLevelAtLeast: 1 include: [...]

with debug level defaulting to 1.  You could crank it down to 0 for
really speed hungry code.  (Similar to CommonLisp's speed/space/safety
settings).
Maybe at debug level 0 you start getting TRO...

Oh well, enough rambling.






More information about the Squeak-dev mailing list