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

[REBOL] Re: Global Words

From: sunandadh:aol at: 22-Jun-2002 12:47

Ammon:
> Someone here (Sunanda?) had a little script that would tell them how many > words are in the global context. I am in dire need of such a thing.
Not me (as I said earlier). But you got me thinking how I could tell if a word is defined in the global context or not. I offer this code -- though I'm not sure why it works. foreach sw first system/words [ either error? try [get to-lit-word mold sw] [ print ["not global " sw] ][ print [" global " sw] ] ] ;;for Of course a word in the global context may also be in other contexts -- I don't know how you'd count how many contexts a word is in without knowing the names of all the existing contexts. Sunanda.