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

[REBOL] Re: "a REBOL dialect is usually limited...

From: carl:cybercraft at: 9-Nov-2002 13:25

On 06-Nov-02, RebOldes wrote:
> Hello Gregg (and rebol-list), > I'm reading the IOS conference now and because this my reply will be > posted much more later, I'm using email not to lost the context.... > on 5.11. you wrote: > --- > RE: "a REBOL dialect is usually limited to REBOL words and block > structure", > I disagree. You can use any words you want in your dialect, and I > wouldn't > call a block structure "limited" but, rather, "ready for > processing". :-) > This is my view, which may not be yours. > --- > I have to disagree, because as I'm working probably on one of the > most complex (public?) dialects -> Rebol/Flash with something like > Rebol-ActionScript compiler, I've found myself limited in the use > of > the 'load function - because I realy don't want to write string > based parser.
I've hit this problem, and it has a downside and an upside. The downside as you quickly find out is that blocks are faster to parse but can't contain everything you like, whereas strings can contain everything but are slower. My solution was to have a two-parse system. I'd first parse the string into a block of words (or numbers or whatever datatypes are most appropriate) and then the main parser would do the real processing. The upside of this is that in the first parse you can not only do a simple conversion of the string to a block, (ie: from a , b to [a comma b]), but also convert it to a format more suited to parsing in REBOL. For instance, the dialect may be slow to parse if you attempt to parse it by following its native form, whereas if you converted it to RPN in the first parse, it might run many times faster during the second parse. -- Carl Read