caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Remi Vanicat <remi.vanicat@laposte.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] quasi newbie question concerning modules presentatiion in the online O'Reilly book
Date: Wed, 17 Mar 2004 09:53:49 +0100	[thread overview]
Message-ID: <87wu5jq2g2.dlv@vanicat.homelinux.org> (raw)
In-Reply-To: <20040317015505.55068.qmail@web41214.mail.yahoo.com> (Vasili Galchin's message of "Tue, 16 Mar 2004 17:55:05 -0800 (PST)")

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


      reply	other threads:[~2004-03-17  8:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-17  1:55 Vasili Galchin
2004-03-17  8:53 ` Remi Vanicat [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wu5jq2g2.dlv@vanicat.homelinux.org \
    --to=remi.vanicat@laposte.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).