Hey there, I' ve been thinking about possible implementations for adding
curryfication to block closures. Here's how it would be used, following by
the implementation.
addBinary := [:p1 :p2 | p1 + p2] .
add3 := addBinary curry: 3.
add3 curry: 5.
8
BlockClosure >> curry: aParameter
(numArgs =
You can use #valueWithArguments: or #valueWithPossibleArgs: instead of using
#value:value:value:
numArgs instVar might be your friend in what you want to achieve.
Regards,
--
View this message in context:
http://forum.world.st/on-blockclosure-currying-tp4660895p4660896.html
Sent from the Phar
Esteban, thanks for your answer.. I think i need to dynamically create a
block which accepts exactly n parameters , so that the new block would
behave as expected. Is that possible ? Is that what you had in mind?
2012/12/25 Esteban A. Maringolo
> You can use #valueWithArguments: or #valueWit
On 26 December 2012 00:54, Sebastián Krynski wrote:
> Esteban, thanks for your answer.. I think i need to dynamically create a
> block which accepts exactly n parameters , so that the new block would
> behave as expected. Is that possible ? Is that what you had in mind?
You have read Vassili By
Frank, yes I have, but I wasn't quite happy with the protocol used nor the
creation of CurriedBlock and Currier classes.
My idea is to create a new method#curry: in BlockClosure, which in
turn, returns another BlockClosure (with n-1 arity).
Thanks again.
2012/12/26 Frank Shearar
> On 26 De