Re: Block evaluation with n+1 arguments

Ralf Propach <[email protected]> Thu, 6 Apr 2023 19:16:14 +0200
Newsgroups gmane.comp.lang.smalltalk.vwnc
Message-ID <[email protected]>
Hi Steffen,

you cannot add such #value:value:[...] methods to BlockClosure, the VM 
does not support them, the maximum is 3.
So the answer to the first question also is: you cannot, except special 
case for args size up to 2.

Ralf

Am 06.04.2023 um 15:28 schrieb Steffen Märcker:
> Hi!
>
> I want to evaluate a block an argument 'arg1' and additional n arguments
> given in an array 'args'. The following code does the trick:
>
>    block valueWithArguments: (Array with: arg1) , args.
>
> Is there a way to do this without the overhead of creating a new Array?
> (How) Can I add additional #value:value:[...] methods to BlockClosure 
> that
> evaluate the block with n arguments directly without falling back to
> #valueWithArguments: ? If yes, what's the maximum?
>
> Cheers!
> Steffen