caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* camlp4o  and lazy: pr_o: not impl: expr; tag = 19
@ 2006-01-03 14:31 Beck01, Wolfgang
  2006-01-03 18:11 ` [Caml-list] " Michel Mauny
  0 siblings, 1 reply; 2+ messages in thread
From: Beck01, Wolfgang @ 2006-01-03 14:31 UTC (permalink / raw)
  To: caml-list

During the holidays I tried to get finally a clue about camlp4.

When I have a small grammar like this:

open Pcaml
EXTEND
	expr:
	[ [
		"bla" ->
			let fe = <:expr< tst() >>
			in
			let lzy = <;expr< lazy $fe$ >>
			in
			<:expr< do_something $lzy$ >>
	] ]
	;
END

and compile it to g3.cmo with

	ocamlc -pp "camlp4o pa_extend.cmo q_MLast.cmo" -I +camlp4 -c g3.ml

and pass a file containing a bla through

	camlp4o ./g3.cmo pr_o.cmo bla.ml

I get
	let _ = do_something<pr_o: not impl: expr; tag = 19>

There seems to be an issue with <:expr< lazy ... When I replace
'lazy' with 'lazi' everything works as expected:

	let _ = do_someting (lazi (tst ()))

Any idea what's wrong here?


Wolfgang
--
T-Systems International GmbH
Technologiezentrum
Next Generation IP Services and Systems
+49 6151 9372863
Am Kavalleriesand 3
64295 Darmstadt



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] camlp4o  and lazy: pr_o: not impl: expr; tag = 19
  2006-01-03 14:31 camlp4o and lazy: pr_o: not impl: expr; tag = 19 Beck01, Wolfgang
@ 2006-01-03 18:11 ` Michel Mauny
  0 siblings, 0 replies; 2+ messages in thread
From: Michel Mauny @ 2006-01-03 18:11 UTC (permalink / raw)
  To: Beck01, Wolfgang; +Cc: caml-list

This is a bug, and I've fixed it in the CVS. Note that you have
the same (buggy) behavior with <:expr< assert e >>.

Both of them happen only when pretty-printing the result, as done by
"camlp4o ./g3.cmo pr_o.cmo". If you use "camlp4o ./g3.cmo" as a
preprocessor to ocamlçocamlopt (through the -pp option), then the
syntax tree produced by camlp4o is correct.

Thanks,

-- Michel

Beck01, Wolfgang wrote/écrivait (Tue, Jan 03, 2006 at 03:31:05PM +0100):
> During the holidays I tried to get finally a clue about camlp4.
> 
> When I have a small grammar like this:
> 
> open Pcaml
> EXTEND
> 	expr:
> 	[ [
> 		"bla" ->
> 			let fe = <:expr< tst() >>
> 			in
> 			let lzy = <;expr< lazy $fe$ >>
> 			in
> 			<:expr< do_something $lzy$ >>
> 	] ]
> 	;
> END
> 
> and compile it to g3.cmo with
> 
> 	ocamlc -pp "camlp4o pa_extend.cmo q_MLast.cmo" -I +camlp4 -c g3.ml
> 
> and pass a file containing a bla through
> 
> 	camlp4o ./g3.cmo pr_o.cmo bla.ml
> 
> I get
> 	let _ = do_something<pr_o: not impl: expr; tag = 19>
> 
> There seems to be an issue with <:expr< lazy ... When I replace
> 'lazy' with 'lazi' everything works as expected:
> 
> 	let _ = do_someting (lazi (tst ()))
> 
> Any idea what's wrong here?
> 
> 
> Wolfgang
> --
> T-Systems International GmbH
> Technologiezentrum
> Next Generation IP Services and Systems
> +49 6151 9372863
> Am Kavalleriesand 3
> 64295 Darmstadt
> 
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-01-03 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-03 14:31 camlp4o and lazy: pr_o: not impl: expr; tag = 19 Beck01, Wolfgang
2006-01-03 18:11 ` [Caml-list] " Michel Mauny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).