Aug 17, 2015; 17:06
deco rior
Best Method
Both of the approaches below give the same result. In one case we pass in a value and modify it without a return. In the second case we pass in a value, and modify it and return it to a variable.
Which is preferred? Speed, etc.
define makemap(m:map)=>{
#m->insert(`a` = 1)
}
local(n) = map
makemap(#n)
#n
=> map(`a`=1)
-----------------------------------------------
Or the alternative…..
define makemap(m:map)=>{
#m->insert(`a` = 1)
return #m
}
local(n) = map
#n = makemap(#n)
#n
=> map(`a`=1)
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>