From: Florian Hars <florian@hars.de>
To: "Kontra, Gergely" <kgergely@mlabdial.hit.bme.hu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Does this function exist?
Date: Tue, 17 Sep 2002 19:17:59 +0200 [thread overview]
Message-ID: <3D8763C7.9050304@hars.de> (raw)
In-Reply-To: <Pine.LNX.4.21.0209171819550.26040-100000@mlabdial.hit.bme.hu>
Kontra, Gergely wrote:
> BTW allowing polimorphism doesn't solve the problem?
No
> Ocaml is strictly
> typed, so one can figure out it's parameter in compile-type, right?
Yes. This is why such a beast as requested at the start of this thread can't be
implemented as a function, but only with some serious compiler magic (that
breaks separate compilation) like the toplevel does.
How would you compile a module like:
type verbose_list 'a = Nil | Cons of 'a * 'a verbose_list
let cons elt l =
print_string "Consing element ";
print elt;
print_string " to list ";
print l;
print_newline ();
Cons (elt, l)
when all you know about elt at compile time is that it is completly polymorphic?
Yours, Florian Hars.
-------------------
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
next prev parent reply other threads:[~2002-09-17 17:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-09 17:56 Lukasz Lew
2002-09-09 19:34 ` John Prevost
2002-09-09 20:18 ` Lukasz Lew
2002-09-09 20:55 ` John Prevost
2002-09-09 20:59 ` Lukasz Lew
2002-09-17 16:21 ` Kontra, Gergely
2002-09-17 17:17 ` Florian Hars [this message]
2002-09-09 21:40 ` Yutaka OIWA
2002-09-09 23:10 ` Nicolas Cannasse
[not found] ` <Pine.LNX.4.44.0209092212360.21417-100000@zodiac.mimuw.edu. pl>
2002-09-09 22:05 ` Chris Hecker
2002-09-09 22:48 ` Remi VANICAT
2002-09-10 1:10 ` Daniel de Rauglaudre
2002-09-16 16:56 ` Kontra, Gergely
2002-09-12 15:31 ` [Caml-list] " Michaël Grünewald
2002-09-18 23:01 [Caml-list] " Gurr, David (MED, self)
2002-09-18 23:01 Gurr, David (MED, self)
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=3D8763C7.9050304@hars.de \
--to=florian@hars.de \
--cc=caml-list@inria.fr \
--cc=kgergely@mlabdial.hit.bme.hu \
/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