Larry wrote:
> REBOL []
>
> print {
> Bug in optional args called from script.
> If 123 is removed from the 6th call to f,
> f is not called at all.
> }
>
> f: func [a [any-type!]][print "f got called"]
>
> f
> f
> f
> f
> f
> f 123
> halt
Actually, there is no bug. Here's a console session:
>> f: func [a [any-type!]][print "f got called"]
>> f
f got called
>> f f f f f f 123 halt
f got called
f got called
f got called
f got called
f got called
f got called
>> f f f f f f 123
f got called
f got called
f got called
f got called
f got called
f got called
>> f f f f f f halt
>>
Note that Rebol evaluates the arguements to a function before calling the
function. In this case:
f f f f f f halt
the 'halt is evaluated just before evaluating the last (or first in
reverse order) 'f function. 'halt has the side effect of stopping execution
of Rebol, so the last 'f is not evaluated.
I hope that helps!
Andrew Martin
Infinitely nested Rebol...
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-