[REBOL] Re: The complete Rebol named argument passing
From: rotenca:telvia:it at: 1-Mar-2004 18:18
Hi Gabriele,
> arguments. To solve this you'd need to parenthesize all
> expressions.
Yes.
The do-alt function could have some limitations not present in the standard
evaluation routine.
But now I have another proposal, with less problems (I hope):
a: "abcd"
b: "c"
case: true
skip: true
size: 2
do-alt find/case/skip a b size
the interpreter fetch the path (find/case/skip) and checks every word in it:
'case
if none/false => refinement /case is false
else => refinement /case is true
'skip
if none/false => refinement /skip is false (size argument will be ignored)
else => refinement /skip is true => size argument required
My doubt is about the size argument when the refinement is none: must be
omitted or it will be ignored (not evalutaed but skipped)?
In the latter case we can write:
my-func: func [a b /case /skip size ][
do-alt find/case/skip a b size
]
also if /skip is none, else we must manually check the skip value in my-func
before calling find.
I already have working mezzanine versions using a block, but i should like to
have a do-alt native.
---
Ciao
Romano