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 BAA29883; Wed, 22 May 2002 01:58:40 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA29777 for ; Wed, 22 May 2002 01:58:40 +0200 (MET DST) Received: from hermes.sc.intel.com (fmr03.intel.com [143.183.121.5]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g4LNwYL27629 for ; Wed, 22 May 2002 01:58:39 +0200 (MET DST) Received: from talaria.sc.intel.com (talaria.sc.intel.com [10.3.253.5]) by hermes.sc.intel.com (8.11.6/8.11.6/d: outer.mc,v 1.46 2002/05/09 18:12:26 root Exp $) with ESMTP id g4LFuUh12362 for ; Tue, 21 May 2002 08:56:30 -0700 (PDT) Received: from mipos2.intel.com (mipos2-seg48.sc.intel.com [143.183.48.42]) by talaria.sc.intel.com (8.11.6/8.11.6/d: inner.mc,v 1.20 2002/05/13 20:36:03 root Exp $) with ESMTP id g4LNvic25519 for ; Tue, 21 May 2002 23:57:44 GMT Received: from zws707.sc.intel.com (zws707.sc.intel.com [143.183.38.79]) by mipos2.intel.com (8.11.6/8.11.6/MailSET/hub) with ESMTP id g4LNwWA29105; Tue, 21 May 2002 16:58:32 -0700 (PDT) Received: (from ctchou@localhost) by zws707.sc.intel.com (8.11.6/8.11.6/MailSET/client) id g4LNwWX27670; Tue, 21 May 2002 16:58:32 -0700 (PDT) Date: Tue, 21 May 2002 16:58:32 -0700 (PDT) Message-Id: <200205212358.g4LNwWX27670@zws707.sc.intel.com> X-Authentication-Warning: zws707.sc.intel.com: ctchou set sender to ctchou@mipos2.intel.com using -f From: Ching-Tsun Chou To: caml-list@inria.fr In-reply-to: (rtarpine@hotmail.com) Subject: Re: [Caml-list] Weird typing problem References: Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Being only a beginner, I think it's because in the interpreter the type of the function doesn't need to be "finalized" completely, while in the compiler must *absolutely* have the exact type so it can generate code. In the interpreter, it's fine for the type to be "refined" later on, because it won't be accessed by any outside applications. The compiler can't generate code for functions with arguments of type '_a because that would require the object code to be modified when the function is called for the first time. The code would need to be changed depending on which program called it, since (list_last [2;3]) and (list_last [2.0;3.0]) would have different effects (the first one would make the type of list_last be ints to ints while the second floats to floats). Why can't the compiler just substitute 'a for '_a if '_a can't be resolved? What's wrong with that? Surely O'Caml can handle polymorphism. - Ching Tsun ------------------- 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