From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA04451; Tue, 17 Sep 2002 19:18:07 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA04800 for ; Tue, 17 Sep 2002 19:18:07 +0200 (MET DST) Received: from grisu.bik-gmbh.de (In-Planung---------X.BIK-GmbH.de [212.12.55.66] (may be forged)) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8HHI6118247 for ; Tue, 17 Sep 2002 19:18:06 +0200 (MET DST) Received: from hars.de (prony.bik-gmbh.de [194.233.237.133]) by grisu.bik-gmbh.de (8.12.3/8.12.3) with ESMTP id g8HHI4U8089698; Tue, 17 Sep 2002 19:18:05 +0200 (CEST) (envelope-from florian@hars.de) Message-ID: <3D8763C7.9050304@hars.de> Date: Tue, 17 Sep 2002 19:17:59 +0200 From: Florian Hars User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.1) Gecko/20020826 X-Accept-Language: de-de, en-us, en MIME-Version: 1.0 To: "Kontra, Gergely" CC: caml-list@inria.fr Subject: Re: [Caml-list] Does this function exist? References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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