caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* include, functor and side-effect
@ 2007-05-15  7:12 Julien Signoles
  0 siblings, 0 replies; only message in thread
From: Julien Signoles @ 2007-05-15  7:12 UTC (permalink / raw)
  To: caml-list; +Cc: Julien Signoles

Hello,

The following code outputs "toto" (both with ocamlc and ocamlopt, test 
with 3.09.2): that's the normal behaviour of the "include" statement.

==========
module F(X:sig end) = struct let x = print_endline "toto" end
module G = struct include F(struct end) end
==========

But if you change "let x = ..." by "let () = ..." as follow, there is no 
more output:

==========
module F(X:sig end) = struct let () = print_endline "toto" end
module G = struct include F(struct end) end
==========

Do you consider this behaviour as a bug or as the normal behaviour of an 
"include" statement?

Note that if you substitute "include" by "module M = ", the code still 
outputs "toto".

Julien Signoles
-- 
mailto:Julien.Signoles@lri.fr ; http://www.lri.fr/~signoles
"In theory, practice and theory are the same,
but in practice they are different" (Larry McVoy)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-15  7:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-15  7:12 include, functor and side-effect Julien Signoles

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