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

[REBOL] Re: Re(2): My first contribution in a lonnnng while

From: jeff:rebol at: 2-Mar-2001 9:28

Howdy, Anton:
> Ok, that's good about loading directories. What about > 'load/markup? I was using it to parse web pages into tags > and text strings for me, then I started to worry that I > might run out of words one day, so I coded my own > read-markup function. Am I right to worry about that?
LOAD/markup also does not create words. TAGS and STRINGs are not words. :-) Brings up an interesting question. If you are writing a script which inspects a lot of other scripts, what you can do is use LOAD/next/header instead of just LOAD. LOAD/next/header %script.r will return a block with the header object in the first spot and the rest of the script as a string in the second position. This means only the words in the header are added to system/words and most of the time REBOL script headers have the same words so nothing more is added. You can load/next/header tons of REBOL scripts and inspect them with reasonable confidence that words will not grow scarce. (In fact, since all of the standard words of a header are already in the system object, you won't likely add any words at all: foreach word next first system/standard/script [ print [word found? find first system/words word] ] (This is the present and future behavior of LOAD/next/header, at least. Early versions, possibly 2.3, may have returned something slightly different). -jeff