Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Can I define an anti function?

From: maximo:meteorstudios at: 24-Feb-2004 12:32

> anti: func [f [any-function!] /local exec] [ > exec: func [block] reduce ['not 'apply 'first reduce [:f] 'block] > func load mold third :f reduce [:exec first :f] > ] >
that's basically what encompass does including all refinements and their values. you can even augment the argument list and refinements if you want additional features. encompass.r in on the site. and is alson included in the slim tool. basically you'd do: myfunc: func [obj word][either in obj word [true][false]] anti-func: encompass/post 'myfunc [rval: not rval] maybe I'm missing the point... as some theory about previous posts is escaping me a little... but for any boolean function, this definitely should work. cheers! -MAx