Hi Ammon,

I would suggest you to try to read
http://www.rebolforces.com/~ladislav/contexts.html . The method described
below is incorrect:

    any-type? a: make error! "OK"
    sw: 'a
    either error? try [get to-lit-word mold sw] [
        print ["not global " sw]
    ][
        print ["    global " sw]
    ]

The result is:

    not global  a

, which looks strange at least (and that is not the only case for which the
result isn't correct). Others have suggested some methods how to get what
you probably want. My guess is, that you would like to have:

    set-in-global?: func [word [any-word!]] [
        not unset? to word! :word
    ]

-L

P.S. (To Sunanda) Some Rebol contexts may not have any name.

----- Original Message -----
From: "Ammon Johnson"

Hi,

I know this is a little slow response, but I thought that you would like to
know that this solution seems to work the best of all that I recieved and I
am currently in the process of building a utility script that will analyze
your script and tell you how many words are in the global context.  This
script I will release when it is complete (or at least ready for testing...)
;-)

Enjoy!!
Ammon


On Saturday 22 June 2002 04:47 pm, you wrote:
> 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.


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to