[wg-camlp4] My uses of syntax extension

Hongbo Zhang hongboz at seas.upenn.edu
Mon Jan 28 17:22:48 GMT 2013


I suggest that you might think twice before you think it's a viable option
---------------------------
2. *Copy and paste, creating two new versions of the parser. *One
version will directly return Haskell abstract syntax for a Haskell
pattern, and the other will return Haskell abstract syntax for an
expression.
*This is potentially a maintenance nightmare.*
Furthermore, we lose a lot of the benefits of the type checker:
a value of type TH.ExpQ is Haskell abstract syntax for an
expression, but knowing this tells us nothing about the type of
the Haskell expression represented by the abstract syntax. This
expression could be an Integer, a String or have any other
type—we know only that it is syntactically correct, not that it is
type correct.

On Mon, Jan 28, 2013 at 11:31 AM, Leo White <lpw25 at cam.ac.uk> wrote:
>> This paper may help you understand how quasi-quotation is implemented
>>
http://ipaper.googlecode.com/git-history/969fbd798753dc0b10ea9efe5af7773ff10f728a/Miscs/why-its-nice-to-be-quoted.pdf
>
>
> You only need the meta filter if you implement quotations using "option 1"
> (see Section 3.1 of the paper). "Option 2", which is what I described in
my
> last post, works perfectly well without it.
>



-- 
-- Regards, Hongbo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocaml.org/pipermail/wg-camlp4/attachments/20130128/d64221d3/attachment.html>


More information about the wg-camlp4 mailing list