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

[REBOL] Re: Selective to-(data-type) Howto?|more

From: arolls:bigpond:au at: 14-Jul-2001 15:42

> 1)the rebol word 'what prints a list of globally-defined functions > 2)It occurs to me that if I can collect that list into a 'block, > I can parse out all of the functions beginning with {to-}.
foreach word first system/words [ if all [ p: find to-string word "to-" 1 = index? p ][ print word ] ] If you want to get the function body of the functions, you can see how the mezzanine function 'what does it. ("mezzanine" meaning made from rebol code. Compare to print, which is a native.) Examine 'what like this:
>> ?? what
what: func [ "Prints a list of globally-defined functions." /local vals args here total ][ total: copy [] vals: second system/words foreach word first system/words [ if any-function? first vals [ args: first first vals if here: find args /local [args: copy/part args here] append total reduce [word mold args] ] vals: next vals ] foreach [word args] sort/skip total 2 [print [word args]] exit ]