caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] quasi newbie question concerning modules presentatiion in the online O'Reilly book
@ 2004-03-17  1:55 Vasili Galchin
  2004-03-17  8:53 ` Remi Vanicat
  0 siblings, 1 reply; 2+ messages in thread
From: Vasili Galchin @ 2004-03-17  1:55 UTC (permalink / raw)
  To: caml-list; +Cc: vasiliocaml

Hello,

    I have been playing with the stack.mli plus
stack.ml implementation that respresents a stack as an
array. If I   package as "module" sig and struct as
presented in
http://caml.inria.fr/oreilly-book/html/book-ora131.html#toc183

When I compile stack.mli and stack.ml as specified
here, I get an error complaining that the
implementation doesn't match the interface and also
missing a STACK field. If I comment all MODULE syntax
at the beginning and end of stack.mli and stack.ml,
then this stack compiles cleanly. Why?

Regards, Vasili


__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

-------------------
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] quasi newbie question concerning modules presentatiion in the online O'Reilly book
  2004-03-17  1:55 [Caml-list] quasi newbie question concerning modules presentatiion in the online O'Reilly book Vasili Galchin
@ 2004-03-17  8:53 ` Remi Vanicat
  0 siblings, 0 replies; 2+ messages in thread
From: Remi Vanicat @ 2004-03-17  8:53 UTC (permalink / raw)
  To: caml-list

Vasili Galchin <vasiliocaml@yahoo.com> writes:

> Hello,
>
>     I have been playing with the stack.mli plus
> stack.ml implementation that respresents a stack as an
> array. If I   package as "module" sig and struct as
> presented in
> http://caml.inria.fr/oreilly-book/html/book-ora131.html#toc183
>
> When I compile stack.mli and stack.ml as specified
> here, I get an error complaining that the
> implementation doesn't match the interface and also
> missing a STACK field. If I comment all MODULE syntax
> at the beginning and end of stack.mli and stack.ml,
> then this stack compiles cleanly. Why?

I believe you have wrote 
stack.mli :
module type STACK =
sig 
...
end

and
stack.ml :
module Stack =
struct
...
end

when you should have wrote
stack.mli :
...

stack.ml :
...

ocaml already know that a mli is a signature, and a ml is a module.

by the way, there is already a stack module in the ocaml standard
library, maybe you could use it, or at least name yours differently.

-- 
Rémi Vanicat

-------------------
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:[~2004-03-17  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-17  1:55 [Caml-list] quasi newbie question concerning modules presentatiion in the online O'Reilly book Vasili Galchin
2004-03-17  8:53 ` Remi Vanicat

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