* [Caml-list] type constructor escape its scope
@ 2002-10-03 9:18 Basile STARYNKEVITCH
2002-10-03 11:12 ` Daniel de Rauglaudre
0 siblings, 1 reply; 2+ messages in thread
From: Basile STARYNKEVITCH @ 2002-10-03 9:18 UTC (permalink / raw)
To: caml-list
Hello List,
[[I'm a bit sick today so brain is badly working... probably a trivial
question I would be ashamed to ask on normal days.. sorry...]]
I compile a selfcontained camlp4 stuff.
You can get it from
http://www2.poesia-filter.org:8000/cgi-bin/cvsweb.cgi/~checkout~/PoesiaSoft/PoesiaMonIcap/pa_filtproto.ml?rev=1.3&content-type=text/plain
It is the pa_filtproto.ml file in PoesiaSoft/PoesiaMonIcap/ revision
1.3 under CVS on www.poesia-filter.org
I've got when compiling with
ocamlc -pp "camlp4o pa_extend.cmo" -I +camlp4 -I . -c pa_filtproto.ml
the strange message
File "pa_filtproto.ml", line 60, characters 7-41:
This expression has type definition_t but is here used with type 'a
The type constructor definition_t would escape its scope
However, definition_t is a type defined in line 37 of the same file
any clues?
Thanks....
N.B. Any opinions expressed here are only mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.
---------------------------------------------------------------------
Basile STARYNKEVITCH ---- Commissariat à l Energie Atomique * France
DRT/LIST/DTSI/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX
phone:+33 1,6908.6055; fax: 1,6908.8395 home: 1,4665.4553; mobile: 6,8501.2359
work email: Basile point Starynkevitch at cea point fr
home email: Basile at Starynkevitch point net
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] type constructor escape its scope
2002-10-03 9:18 [Caml-list] type constructor escape its scope Basile STARYNKEVITCH
@ 2002-10-03 11:12 ` Daniel de Rauglaudre
0 siblings, 0 replies; 2+ messages in thread
From: Daniel de Rauglaudre @ 2002-10-03 11:12 UTC (permalink / raw)
To: caml-list
Hi,
On Thu, Oct 03, 2002 at 11:18:18AM +0200, Basile STARYNKEVITCH wrote:
> I've got when compiling with
> ocamlc -pp "camlp4o pa_extend.cmo" -I +camlp4 -I . -c pa_filtproto.ml
> the strange message
>
> File "pa_filtproto.ml", line 60, characters 7-41:
> This expression has type definition_t but is here used with type 'a
> The type constructor definition_t would escape its scope
This happens typically in this situation:
$ cat foo.ml
let x = ref [];;
type t = C;;
x := [C];;
$ ocamlc -c foo.ml
File "foo.ml", line 3, characters 6-7:
This expression has type t but is here used with type 'a
The type constructor t would escape its scope
The problem is that at the *definition* of "x", the type "t" does
not exist yet. The type of "x" is deferred, but is actually
"t list ref". But, since "t" is defined after, it would not be
possible to defined it with a type constraint:
let x = ref ([] : t list);;
I did not look at your example, but search something around that. If it
is some obscur code generated by Camlp4, it can be more difficult: in
this case, I can look at it, if you need.
--
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-10-03 11:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-03 9:18 [Caml-list] type constructor escape its scope Basile STARYNKEVITCH
2002-10-03 11:12 ` Daniel de Rauglaudre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox