|
![](/i/fill.gif) |
Slime wrote:
>>My problem seems to be that the formal parameters supplied to the function
>>don't seem to be in scope for the expressions. It is as thought they were
>>not declared.
>
>
> They aren't. Commands beginning with # are evaluated at parse time in order
> to get the tokens which are used to generate the objects they surround: in
> this case, the function. So as the # commands are evaluated, the function
> doesn't exist yet, and once the function is finished being created, the #
> commands are already taken care of and are never seen again.
>
Do arrays work in the same way ? I recall having tried to get a value in
an array, indexed by a parameter of a function (something like
function(x) {myarray[floor(x)]} ) and never being able to find a way to
do so...
--
Vincent
Post a reply to this message
|
![](/i/fill.gif) |