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

Parsing problem

 [1/2] from: ptretter::charter::net at: 22-Jul-2001 9:01


I know this topic has been on the list before but if I have the following: a: ['blah ['blah2 'blah3]] How do I parse the brackets from 'a Paul Tretter

 [2/2] from: brett:codeconscious at: 23-Jul-2001 13:03


Hi Paul,
> a: ['blah ['blah2 'blah3]] > > How do I parse the brackets from 'a
'a refers to a block so we're talking block mode. The keyword you want is INTO.
>> parse a [lit-word! into [2 lit-word!] ]
== true or a different example:
>> b: [blah [blah2 blah3]]
== [blah [blah2 blah3]]
>> parse b [word! into ['blah2 word!] ]
== true BTW just to avoid confusion for people reading this thread: The block in your example that the word 'a refers to does not contain any brackets - only a word! and a block!. The brackets only exist as actual brackets in the textual (string!) form (prior to loading by Rebol) of the code. HTH! Brett.