[wg-camlp4] Meta Programming from the view of the implementaion

Török Edwin edwin+ml-ocaml at etorok.net
Thu Jan 31 13:21:46 GMT 2013


On 01/31/2013 01:48 PM, Leo White wrote:
> So I propose the we include 3 template forms:
> {: lid x| string |x}            (where x is an optional symbol character)

I'd be in favour of just 1 syntax, its less confusing for users.

On 01/31/2013 02:46 PM, Hongbo Zhang wrote:
> why should we introduce so many  concrete syntax notation here?
> 
> In Fan,
> {:json| ... |}
> if "|}" is used inside,*the user (optionally) can introduce a new separator following "|" immediately*
> {:json|/ ... /|}  

So this would be similar to Leo's proposal but with the optional symbol on the inside, a mandatory whitespace
after the symbol, and no whitespace after the : right?
{:lid|x␣string x|}

I actually prefer this one because:
 + easier for editors to highlight beginning/end of quote
 + easier to grep for end of quote
 + easier to grep for what syntax extensions are used in a project: grep -Eo "{:[^|]+|"

FWIW Haskell is quite rigid, its syntax for (quasi)quotations is just [expr|...|].

Best regards,
--Edwin



More information about the wg-camlp4 mailing list