[REBOL] Re: Can I define an anti function?
From: rotenca:telvia:it at: 24-Feb-2004 14:48
Ok, Lad
this is my solution, (without refinements handling and without get and lit
arguments and without optimizations)
Do not read if you want to try by yourself.
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
anti: func [[catch] :f /local body][
body: copy []
parse first :f [
some [
[end | refinement!] break |
set x word! (insert insert/only tail body 'get/any to lit-word! x) |
(make error! "get and lit arguments not handled")
]
]
throw-on-error [make function! first :f head insert insert tail reduce [:not]
:f body]
]
---
Ciao
Romano