* camlp4 and dirac notation
@ 2007-03-19 17:55 michel levy
2007-03-19 20:04 ` [Caml-list] " Nicolas Pouillard
0 siblings, 1 reply; 2+ messages in thread
From: michel levy @ 2007-03-19 17:55 UTC (permalink / raw)
To: caml-list
I try to modify the ocaml syntax with camlp4 to add the Dirac notation
|v >.
Have you any solution ?
I have tried with
EXTEND
expr : LEVEL "simple"
[["|"; e=expr ;">" -> <:expr< ket $e$>>]
];
END;;
but I have the following message
|z>;;
^^
Parse error: [expr] expected after '>' (in [expr])
I can replace > by : but it is not the dirac notation.
Have you any idea ?
--
Michel Levy
L.S.R., Bureau C214, B.P.72 - 38402 SAINT MARTIN D'HERES CEDEX
e.mail : Michel.Levy@imag.fr tel :(33)476514022
http://www-lsr.imag.fr/users/Michel.Levy
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] camlp4 and dirac notation
2007-03-19 17:55 camlp4 and dirac notation michel levy
@ 2007-03-19 20:04 ` Nicolas Pouillard
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Pouillard @ 2007-03-19 20:04 UTC (permalink / raw)
To: michel levy; +Cc: caml-list
On 3/19/07, michel levy <michel.levy@imag.fr> wrote:
> I try to modify the ocaml syntax with camlp4 to add the Dirac notation
> |v >.
> Have you any solution ?
>
> I have tried with
> EXTEND
> expr : LEVEL "simple"
> [["|"; e=expr ;">" -> <:expr< ket $e$>>]
e = expr LEVEL "simple"
You don't want to allow any expression here since it will be ambiguous
with the '>' operator.
You even perhaps don't want an expression here |(f x y z)> seems not
really readable, you can allow only identifiers.
[["|"; id = LIDENT ;">" -> <:expr< ket $lid:id$>> ]]
Hope this helps,
--
Nicolas Pouillard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-19 20:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-19 17:55 camlp4 and dirac notation michel levy
2007-03-19 20:04 ` [Caml-list] " Nicolas Pouillard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox