* Camlp4 3.10 - antiquotations in keyword position?
@ 2007-04-24 0:07 Aleksey Nogin
2007-04-24 0:12 ` [Caml-list] " Nicolas Pouillard
0 siblings, 1 reply; 3+ messages in thread
From: Aleksey Nogin @ 2007-04-24 0:07 UTC (permalink / raw)
To: Caml List
In 3.09 we used to allow defining "infix" keywords by using
antiquotations in inside the "EXTEND" and "DELETE_RULE" directives as
follows:
--------------------------------------------------------------
(*
* The prefix version of the infix expression
*)
let prefix_name op =
"prefix_" ^ op
(*
* Add an infix keyword.
*)
let add_infix (keyword : string) =
EXTEND
GLOBAL: expr;
expr: LEVEL "expr1"
["expr1" LEFTA
[ e1 = expr; op = $keyword$; e2 = expr ->
<:expr< $lid:prefix_name op$ $e1$ $e2$ >>
]];
END
(*
* Remove the infix keyword.
*)
let remove_infix (keyword : string) =
DELETE_RULE
expr:
expr; $keyword$; expr
END
--------------------------------------------------------------
This does not seem to be supported in 3.10. Is there some other way to
achieve a similar effect in 3.10? Thanks!
Aleksey
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] Camlp4 3.10 - antiquotations in keyword position?
2007-04-24 0:07 Camlp4 3.10 - antiquotations in keyword position? Aleksey Nogin
@ 2007-04-24 0:12 ` Nicolas Pouillard
2007-04-26 16:25 ` Aleksey Nogin
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Pouillard @ 2007-04-24 0:12 UTC (permalink / raw)
To: Caml List, Aleksey Nogin
On 4/24/07, Aleksey Nogin <nogin@metaprl.org> wrote:
> In 3.09 we used to allow defining "infix" keywords by using
> antiquotations in inside the "EXTEND" and "DELETE_RULE" directives as
> follows:
>
[...]
> This does not seem to be supported in 3.10. Is there some other way to
> achieve a similar effect in 3.10? Thanks!
You can try something like
.... op = KEYWORD $x$ ...
Regards,
--
Nicolas Pouillard
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] Camlp4 3.10 - antiquotations in keyword position?
2007-04-24 0:12 ` [Caml-list] " Nicolas Pouillard
@ 2007-04-26 16:25 ` Aleksey Nogin
0 siblings, 0 replies; 3+ messages in thread
From: Aleksey Nogin @ 2007-04-26 16:25 UTC (permalink / raw)
To: Nicolas Pouillard; +Cc: Caml List
On 23.04.2007 17:12, Nicolas Pouillard wrote:
> You can try something like
>
> .... op = KEYWORD $x$ ...
Thanks, that worked!
P.S. I tried it before sending the email, but as I only had
Camlp4.PreCast.Syntax opened and not Camlp4.PreCast, I got an error
message and erroneously decided that this was not the right solution.
Aleksey
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-04-26 16:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-24 0:07 Camlp4 3.10 - antiquotations in keyword position? Aleksey Nogin
2007-04-24 0:12 ` [Caml-list] " Nicolas Pouillard
2007-04-26 16:25 ` Aleksey Nogin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox