|
>
> That looks good.
> How does the body:[ ... ] part parse? Is there a way of quickly
> 'skipping' from start '[' to the end ']' without having to parse the
> source in the midlle with a full Smalltalk parser? It can't just skip
> matching '[ ]' pairs, in case there are ']' embedded in strings etc. ,
> right?
You just let it compile as per normal. It has errors - but when you go
to call the block, you reflect back to the parse tree and extract the
source code.
It's a rather simple trick of self-reflecting code. It's kind of a shame
that blocks don't already ahve access to their own source code like
methods do - but whatcha gunna do :)
Michael
|