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

[REBOL] parse or Re:(2)

From: rchristiansen:pop:isdfa:sei-it at: 20-Sep-2000 15:54

> paragraphs: {First paragraph.^/Second "paragraph."^/Third paragraph.} > parse paragraphs [some [thru {.^/} | thru {."^/} | thru "." end]]
This returns "true" But what if I'm trying to parse a report and wish to make each paragraph a separate string within a block?
>> paragraphs: {First paragraph.^/Second "paragraph."^/Third
paragraph.} == {First paragraph. Second "paragraph." Third paragraph.}
>> >> paragraphs-breakdown: []
== []
>> >> foreach paragraph parse paragraphs [some [thru {.^/} | thru {."^/} |
thru "." end]] [append paragraphs-breakdown paragraph] ** Script Error: foreach expected data argument of type: series. ** Where: foreach paragraph parse paragraphs [some [thru ".^/" | thru {."} | thru "." end]] Doesn't work. Sorry if I'm being a pain, but when I read the "parse rules" documentation it doesn't make any sense to me. I can't see the usefulness of returning "true" in this situation.