I'm playing with adding a little currying stuff to BlockClosure.
To have it done dynamically (ie. not hardcoding all the cases for different number of arguments of the original block) I'd need to construct BlockClosures dynamically, in order to pass the varying number of arguments.
Is there a way to do it, even if it involves some kind of dynamic eval/compile?
Is the following what you are lookig for? In a workspace try:
|myBlock|
myBlock := Compiler evaluate: '[ 1 + 2 ]'.
Now you have compiled a block from a string:
myBlock class -> BlockClosure
and can evaluate it:
myBlock value -> 3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With