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

[REBOL] Re: Parse versus Regular Expressions

From: joel:neely:fedex at: 4-Apr-2003 17:28

Hi, Gabriele, Gabriele Santilli wrote:
> JN> 1) It makes the PARSE dialect a strange hybrid between declarative > JN> and procedural descriptions (as mentioned in my earlier post). > > The PARSE dialect is something that is matched to the input string > or block from left to right. I'm not sure if this makes it an > hybrid; probably it does, and I admit I like it this way. (Much > better than RE, that is.) >
My point (regarding declarative-vs-procedural) was simply that RE notation purely describes the pattern one is looking for, and the RE engine manages all the complexity for you, *including* the cases where backtracking is necessary to find a complete match after a false start. It appears to me that PARSE requires the programmer to do more work when backtracking may be needed. The specific example at hand required the programmer to take action to make the first alternative fail before PARSE would consider the second. It would be nice if failure at the end of the *entire* rule also caused backtracking so the programmer didn't have to do any extra work. -jn- -- ---------------------------------------------------------------------- Joel Neely joelDOTneelyATfedexDOTcom 901-263-4446 Counting lines of code is to software development as counting bricks is to urban development.