Hello REBOLs,
I wanted to know how many words REBOL is capable of using, so I did a little
experiment:
>> system/version
== 2.2.0.3.1
>> length? first system/words
== 1178
>> for x 1 1000 1 [to word! join "word" x]
** Internal Error: No more global variable space.
** Where: to word! join "word" x
>> length? first system/words
== 1534
If I don't run any scripts from %user.r I get:
>> length? first system/words
== 950
>> for x 1 1000 1 [to word! join "word" x]
** Internal Error: No more global variable space.
** Where: to word! join "word" x
>> length? first system/words
== 1534
As you may know, once a word is created as data, it gets stored in
system/words, and never goes away, whether it is ever bound to anything or
not. Recycling seems to have no effect.
I'm not in any immediate danger of running out of words, but clearly if you
do a lot of different things in one instance of REBOL, it would be a good
idea to store as little data as possible in global words, and to try to use
standardized words with local bindings within objects or functions so that
many data structures can share the total supply of words.
Also, I've written several functions with a ' on their argument sepcifications
to allow the arguments to be entered as words rather than bothering to
enclose them with " ". For example the header of HUH looks like:
huh: func [
{Print a list of globally defined words classified by datatype}
'pattern [word! string! unset!] "matching pattern (. and * wild)"
'type [word! unset!] "datatype test function (eg series?)"
/any {displays words containing any type of value, even unset}
/wc {use ? and + for wild cards}
/local tester words word-array this-type
][ ... ]
I often search for a function name like this:
>> huh *split*
@@ function!
split-block split-path
which means the word '*split* is now using up valuable real estate.
Of course that is just a problem of my own making, but still, given that
"dialecting" is advertised as one of the major selling-points of REBOL, it's
too bad the number of usable words in REBOL is so low.
Any comments?
Eric