[REBOL] Re: Can I define an anti function?
From: lmecir:mbox:vol:cz at: 24-Feb-2004 15:55
Hi Romano,
>Ok, Lad
>
>this is my solution, (without refinements handling and without get and lit
>arguments and without optimizations)
>
I have got a few notes:
1) I am still not convinced, that a "get argument", (alias "fetched
argument") is a good argument passing method. The disadvantage of it is,
that you cannot easily supply a result of an expression as an argument.
Example:
anti func [x [logic!]] [x] ; this is hard to write correctly using
the above method
No native or mezzanine Core function uses this argument-passing method
(although there are natives in Rebol/Core that can take functions as
arguments).
Allow me to poll other users: how many of you use this argument passing
method?
anti: func [:f ] [...]
2) Otherwise your solution is very close. The only bug is probably this:
>> f: func [get] [true]
>> anti-f: anti f
>> anti-f false
** Script Error: Cannot use path on logic! value
** Where: anti-f
** Near: native func [get][true] get/any 'get
-L