caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Ocaml crash
@ 2001-11-15 11:03 Rolf Wester
  2001-11-15 16:09 ` Eric C. Cooper
  2001-11-19 15:23 ` Xavier Leroy
  0 siblings, 2 replies; 3+ messages in thread
From: Rolf Wester @ 2001-11-15 11:03 UTC (permalink / raw)
  To: caml-list

Hi,

I have a class mirror and a type mirror in the same module. This compiles
without emitting an error. But when I run the toplevel built with this module
and type:

let m1 = new mirror ...;;

the toplevel crashes displaying an error dialoge with the message 
(WinNT VC++6 in German):

Die Anweisung in "0x00447324" verweist auf Speicher "0x00000009". ...
(I think in English this reads: The instruction  "0x00447324" points to
memery location "0x00000009". ...)

Of course it's a bad idea to name a class and a type definition the same but
I had expected the compiler to throw an error. Is this documented anywhere?


Besides this I have a question concerning modules. Is it possible to spread
the implementation of a module over several files and if how is it done?   

Thanks

Rolf Wester

-------------------------------------
Rolf Wester
rolf.wester@ilt.fraunhofer.de
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] Ocaml crash
  2001-11-15 11:03 [Caml-list] Ocaml crash Rolf Wester
@ 2001-11-15 16:09 ` Eric C. Cooper
  2001-11-19 15:23 ` Xavier Leroy
  1 sibling, 0 replies; 3+ messages in thread
From: Eric C. Cooper @ 2001-11-15 16:09 UTC (permalink / raw)
  To: caml-list

On Thu, Nov 15, 2001 at 01:03:00PM +0200, Rolf Wester wrote:
> I have a class mirror and a type mirror in the same module. This compiles
> without emitting an error.

The 3.0.3 compiler rejects this with an error:
    Multiple definition of the type name foo.
    Names must be unique in a given structure or signature.

-- 
Eric C. Cooper          e c c @ c m u . e d u
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] Ocaml crash
  2001-11-15 11:03 [Caml-list] Ocaml crash Rolf Wester
  2001-11-15 16:09 ` Eric C. Cooper
@ 2001-11-19 15:23 ` Xavier Leroy
  1 sibling, 0 replies; 3+ messages in thread
From: Xavier Leroy @ 2001-11-19 15:23 UTC (permalink / raw)
  To: Rolf Wester; +Cc: caml-list

> I have a class mirror and a type mirror in the same module. This compiles
> without emitting an error. But when I run the toplevel built with this module
> and type:
> 
> let m1 = new mirror ...;;
> 
> the toplevel crashes

This is a known bug (PR#478 in our bug database :-).  It is fixed in
the working sources, and also in 3.03 alpha.

> Besides this I have a question concerning modules. Is it possible to spread
> the implementation of a module over several files and if how is it done?   

You can implement several modules A1, A2, ..., possibly each in its own
file, then re-export the relevant parts in the "main" module A, e.g.

A.ml:
        include A1                      (* re-export everything from A1 *)
        include (A2 : sig ... end)      (* selective re-export from A2 *)
        ...

- Xavier Leroy
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

end of thread, other threads:[~2001-11-19 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-15 11:03 [Caml-list] Ocaml crash Rolf Wester
2001-11-15 16:09 ` Eric C. Cooper
2001-11-19 15:23 ` Xavier Leroy

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).