Nice syntax for using derived names. When generating code where the identifiers are based on existing identifiers or even new names, this looks rather ugly. In the condition of a rule you have to do the string manipulation, bind the result to some generic meta-variable, and use that in the code fragment. Consider for example, the following fragment from dynamic rule lifting in the Stratego Compiler front-end:

           <conc-strings>("aux-", f) => f'  // has to be the same such that + of aux-f works
         ; <conc-strings>("bagof-", f) => g
         ; <conc-strings>("once-", f) => g2
         ; <conc-strings>("bigbagof-", f) => g3
         ...
         ; ![ ...
              |[ g(as1|as2) : x@t1 -> <filter(f'(s1*|t1'*))> closures
                   where (dr-lookup-rule(|~str:f, t1'') <+ ![]) => closures ]|,

It would be better if we can write something like

             |[ 'bagof-f'(as1|as2) : x@t1 -> <filter('aux-f'(s1*|t1'*))> closures
                   where (dr-lookup-rule(|'f', t1'') <+ ![]) => closures ]|,

Something like this was done for the concrete syntax embedding for Prolog; see DSPG’03 paper of Fischer & Visser.

Submitted on 21 July 2005 at 15:52

On 9 January 2013 at 16:55 Eelco Visser removed tag 0.21

On 9 January 2013 at 16:55 Eelco Visser tagged interesting

Log in to post comments