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

Global Words

 [1/13] from: ammon::rcslv::com at: 21-Jun-2002 10:27


Hi, 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. Thanks!! Ammon

 [2/13] from: greggirwin:mindspring at: 21-Jun-2002 12:21


Hi 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. >> Well, for overall usage, you can just do:
>>length? first system/words
I think someone had a more sophisticated bit that told you how many words your script added though, by using QUERY. Couldn't find it at a glance here though. --Gregg

 [3/13] from: sunandadh:aol at: 21-Jun-2002 17:20


Ammon:
> Someone here (Sunanda?) had a little script that would tell them how many > words are in the global context.
Sorry. Not me. And I've had a look around and can't find anything useful either. Sunanda.

 [4/13] from: carl:cybercraft at: 22-Jun-2002 9:09


On 22-Jun-02, Gregg Irwin wrote:
> Hi Ammon, > << Someone here (Sunanda?) had a little script that would tell them
<<quoted lines omitted: 5>>
> words your script added though, by using QUERY. Couldn't find it at > a glance here though.
Someone (I forget who:) had posted the following a while back. It allows you to save all words used, but I'm sure you could modify it to give you the info you need. REBOL [ Title "Save All View Words" ] view layout [ title "Save All View Words" across button "Save" [ all-view-words: " " all-view-words-count: 0 all-words: sort first system/words write %all-view-words.txt " *** All View Words ***^/^/" forall all-words [ all-view-words: rejoin [all-view-words " " first all-words] all-view-words-count: all-view-words-count + 1 if all-view-words-count = 4 [ write/append %all-view-words.txt join all-view-words ^/ all-view-words: " " all-view-words-count: 0 ] ] write/append %all-view-words.txt "^/" ] button "Quit" [unview/all] ] -- Carl Read

 [5/13] from: ammon:rcslv at: 21-Jun-2002 19:49


Hi, That tells you all of the words that are in use, not just in the Global namespace... I need to know what words are in the global namespace... Hm.. I will look around a little more, I might have it somewhere, but I know that I sent it to Etienne to help him clean up his Skins so that they only used 2 global words. Do you still have that Etienne? Thanks!! Ammon On Friday 21 June 2002 05:09 pm, Carl Read wrote:

 [6/13] from: nitsch-lists:netcologne at: 22-Jun-2002 13:08


Hi Ammon ;new local words would also reported. ;so make sure the new words are present in system/words ;because of that load all used scripts first load %main.r load %script1.r load %script2.r .. query/clear system/words do %main.r probe query system/words Am Samstag, 22. Juni 2002 01:49 schrieb Ammon Johnson:

 [7/13] 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.

 [8/13] from: g:santilli:tiscalinet:it at: 22-Jun-2002 20:49


Hi SunandaDH, On Saturday, June 22, 2002, 6:47:12 PM, you wrote: Sac> Not me (as I said earlier). But you got me thinking how I could tell if a Sac> word is defined in the global context or not. UNSET? is what does the job. :-) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [9/13] from: ammon:rcslv at: 1-Jul-2002 9:10


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:

 [10/13] from: lmecir:mbox:vol:cz at: 2-Jul-2002 10:01


Hi myself, I used the incorrect function before. The correct function is: set-in-global?: func [word [any-word!]] [ value? to word! :word ] Sorry for the misleading mail -L

 [11/13] from: lmecir:mbox:vol:cz at: 2-Jul-2002 9:48


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:

 [12/13] from: ammon:rcslv at: 1-Jul-2002 23:52


Hi, It is a good thing that you corrected yourself, I would have let you know as I already attempted the "unset?" version with no luck! ;-) Glad to see that there is a function that will let me know if a word exists in a given context though. Thanks for the input. Oh, how valuable this list is. ;-) Thanks!! Ammon A short time ago, Ladislav Mecir, sent an email stating:

 [13/13] from: lmecir:mbox:vol:cz at: 3-Jul-2002 9:23


Hi Ammon, in my opinion we should distinguish two different situations. The first one is, whether a given word exists in a given context. Example: in system/words first to block! "xxx" ; == none This tells us, that the word 'xxx doesn't exist in the Global context. Another example: o: make object! [a: 1 unset 'a] in o 'b ; == none This tells us, that 'b doesn't exist in the object. If we try 'a we get a different result: in o 'a ; == a On the other hand, if we want to know, whether 'a has got a value, we will find out: value? in o 'a ; == false , i.e. the word exists in the context, but it doesn't have a value. Hope it is of some use, -L Hi, It is a good thing that you corrected yourself, I would have let you know as I already attempted the "unset?" version with no luck! ;-) Glad to see that there is a function that will let me know if a word exists in a given context though. Thanks for the input. Oh, how valuable this list is. ;-) Thanks!! Ammon A short time ago, Ladislav Mecir, sent an email stating:

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted