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

[REBOL] simple parse and copy question Re:

From: joel::neely::fedex::com at: 4-Oct-2000 10:16

Hi, Sharriff... [Sharriff--Aina--med-iq--de] wrote:
> >> help copy > USAGE: > COPY value /part range /deep > > considering: > > "parse page [thru <title> copy text to </title> ] " > > copy is evaluted towars the RIGHT side, copies values into WORD! text > > am I to take this as it is? can someone explain exactly why this > particular example works this way. >
The answer is that help copy gives you the normal usage of copy as a word in standard REBOL. However, inside a setting such as parse something [ ... copy bletch somerulepart ...] the word copy is used as a part of the parsing dialect. (See the new docs, chapter 14, for an explanation -- esp. pp. 14-14 and 14-27.) In that dialect (using the above partial example) the variable following the word copy receives a copy of whatever matches the following somerulepart . The help (or ? variant) function only deals with top-level usage of words, which is also why you get
>> ? thru
No information on thru (word has no value) for another word in the parsing dialect. HTH! -jn- -- ; Joel Neely [joel--neely--fedex--com] 901-263-4460 38017/HKA/9677 REBOL [] print to-string debase decompress #{ 789C0BCE0BAB4A7176CA48CAB53448740FABF474F3720BCC B6F4F574CFC888342AC949CE74B50500E1710C0C24000000}