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

[REBOL] Re: Parse rules as data

From: joel:neely:fedex at: 27-Jun-2001 10:24

Hi, Brett, Brett Handley wrote:
> The idea you think I had appears not to be the one I think > I had. But you're most welcome to pursue the former, though > my interest is actually in the latter. >
You're welcome to credit for both! ;-) I was just observing another application of the root notion of "reverse interpreting" the parse dialect.
> Then I'd like to provide a new model and have content > "calculated" for me doing something like: > > rebsite: transform author-index rebsites-spec hints-spec > > where rebsites-spec is > > rebsite-spec: context [ > reblink: ['folder linkurl 'info author] > author: [string!] > linkurl: [url!] > model*: [ any reblink ] > ] > > and hint-spec contains the magical transformation dialect > that makes it all possible :) >
...
> So I guess I'm wondering if some function 'transform and some > fantastic transformation dialect will be more economical than > just writing the transformation directly in straight Rebol code. >
I'd guess it depends on how often one does transformations that are sufficiently similar. There are probably situations where the (possibly high) investment in effort to implement the transformer would have a payback over repeatedly hand-crafting the individual translations, but I'd need LOTS of experience doing the specific cases before I'd feel comfortable doing the general case.
> Should I go back to dreaming? >
Dreams are good! For some dream-inspiration, take a look at the specs for XSL and XSLT at http://www.w3.org/Style/XSL/ They're addressing the corresponsing problem for XML -- given one structure expressed in XML, how can one write rules that specifiy how to map it to a different structure in XML/HTML/XHTML? It might give you some more ideas. -- It's turtles all the way down! joel'dot'neely'at'fedex'dot'com