May 29
Adam de Zoete L9 assignment to self
May 29, 2012; 19:26
Adam de Zoete
L9 assignment to self
May 29
Ke Carlton Re: L9 assignment to self
May 29, 2012; 20:04
Ke Carlton
Re: L9 assignment to self
All methods can be address dynamically – providing the signature aligns:
define mytype => type {
data
public test1 = 'not set',
public test2 = 'not set'
public oncreate => {
local(v = 'Some value')
with i in array('test1','test2') do {
#i = tag(#i+'=')
self->\#i(#v)
}
}
}
mytype->test1 // Some value
mytype->test2 // Some value
The approach is somewhat different compared to older versions. Essentially
your invoking the tag within the context of self. You also need to append as part of the tag and provide the parameter to set within the invoke() –
the above does essential this:
self->test1 = #v
Given the abstract nature nature of the above, it'd probably be best to
wait for Kyle to confirm its validity...
Ke
On 29 May 2012 19:26, Adam de Zoete <lists@dezoete.co.uk> wrote:
> Due to the lack of dynamic locals in lasso9, has anyone found out a decent
> way to mass assign locals to self?
>
> i.e. in oncreate..
>
> local('keys_in') = array(
> 'filter',
> 'sku',
> 'id',
> 'ref'
> );
>
> iterate(#keys_in, local('i'));
> local_defined(#i) ? self -> (#i) = local(#i);
> /iterate;
>
> Is the only way forward individual assignment now?
>
> Adam
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
May 29
Adam de Zoete Re: L9 assignment to self
May 29, 2012; 23:59
Adam de Zoete
Re: L9 assignment to self
May 30
Ke Carlton Re: L9 assignment to self
May 30, 2012; 02:00
Ke Carlton
Re: L9 assignment to self
May 29
deco rior Re: L9 assignment to self
May 29, 2012; 20:33
deco rior
Re: L9 assignment to self
May 30
Adam de Zoete Re: L9 assignment to self
May 30, 2012; 08:23
Adam de Zoete
Re: L9 assignment to self
May 30
Adam de Zoete Re: L9 assignment to self
May 30, 2012; 08:30
Adam de Zoete
Re: L9 assignment to self
May 30
Ke Carlton Re: L9 assignment to self
May 30, 2012; 15:39
Ke Carlton
Re: L9 assignment to self
May 30
Adam de Zoete Re: L9 assignment to self
May 30, 2012; 16:16
Adam de Zoete
Re: L9 assignment to self