Hi,

Here is a slice that implements the  #argsAsArray option:
 
        https://pharo.fogbugz.com/f/cases/19857/add-option-argsAsArray

from a speed perspective, the question is if a dictionary makes sense… as it 
would
need to be created at runtime.

        Marcus

> On 15 Mar 2017, at 11:25, denker <marcus.den...@inria.fr> wrote:
> 
> 
>> On 15 Mar 2017, at 11:09, Peter Uhnak <i.uh...@gmail.com> wrote:
>> 
>> On Wed, Mar 15, 2017 at 10:49:51AM +0100, denker wrote:
>>> 
>>>> On 15 Mar 2017, at 10:35, Peter Uhnak <i.uh...@gmail.com> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> is it possible to create a metalink on arbitrary amount of arguments?
>>>> 
>>>> Right now the metaObject and selector must have the same number of 
>>>> arguments, e.g.
>>>> 
>>>> MetaLink new
>>>>    metaObject: [ :object :selector :args | ... ];
>>>>    selector: #value:value:value;
>>>>    arguments: #(object selector arguments)
>>>> 
>>>> 
>>>> What I would like to have instead is something like...
>>>> 
>>>> MetaLink new
>>>>    metaObject: [ :allArgs | ... ];
>>>>    selector: #value:;
>>>>    arguments: #(object selector arguments)
>>>> 
>>>> 
>>>> And then `allArgs` would either be an array with all the arguments, or 
>>>> maybe a Dictionary.
>>>> 
>>> 
>>> Right now not… but it would be a nice addition. 
>>> 
>>> It could either use some magic (if the number of args requested are larger 
>>> then the number of args
>>> of the selector it gives the rest as a dictionary).
>>> 
>>> or, maybe better (less magic), this could be an option to be configured per 
>>> link:
>>> 
>>> 
>>> MetaLink new
>>>     metaObject: [ :allArgs | ... ];
>>>     selector: #value:;
>>>     arguments: #(object selector arguments)
>>>     options: #(argsAsDictionary)
>>> 
>>> (which would allow #argsAsArray, too).
>>> 
>>>     Marcus
>> 
>> 
>> +1 for option, magic only brings suffering. :)
>> 
> 
> This should be easy.. I will look into it hopefully this week.
> 
>       Marcus
> 


Reply via email to