On 1 avr. 09, at 10:46, Tudor Girba wrote:
Hi,
asSortBlock is implemented in CodeFoo and CodeFoo is apparently
under MIT (see the bundle comments in VW).
anyway, another implementation would be:
^ [:a :b | (a value: self) <= (b value: self)]
I suppose you meant (might be different in VW though)
^ [:a :b | (a perform: self) <= (b perform: self) ]
Very elegant :)
It's funny how one can be easily get obfuscated when dealing with meta
stuff
Cheers,
Doru
On 30 Mar 2009, at 19:55, Simon Denier wrote:
I need the following method from VW to run some
tests in SqMoose.
Does anybody have an idea about its licence? Does not seem to be
part of our own extensions :(
It's not especially difficult to reimplement one, anyone can come
up with a Squeak/Pharo equivalent (although it works as is under
Pharo, perhaps there is a better way)
Symbol>>asSortBlock
"Answer a sort block, which evaluates this symbol for both arguments
and compares the resulting values"
| stream |
stream := (String new: self size * 2 + 14) writeStream.
stream
nextPutAll: '[:a :b | a ';
nextPutAll: self;
nextPutAll: ' <=b ';
nextPutAll: self;
nextPut: $].
^Compiler evaluate: stream contents
--
Simon
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Every now and then stop and ask yourself if the war you're fighting
is the right one."
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
Simon