2010/7/22 Sudhakar Krishnamachari
<skrishnamachari@gmail.com>
And of course the extensibility it gives:
[ 1->'asd'. 2->'asd'. 3->'dsd' ] asDictionary
I think Travis Griggs' once is much much nicer:
[{ 1->'asd'. 2->'asd'. 3->'dsd' } asDictionary] once
when once is sent to a BlockClosure it becomes itself into a CachedBlockClosure that remembers and answers the evaluated value.
You could add selectors to this such as
onceEachSession - destroy the cached value on image startup
It doesn't require any special compiler machinery (unlike ##(...)) and so there are no problems with browsing references or senders within compile-time evaluated forms. It is easily extensible to different life-times. It is portable.
my 2�
Eliot