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 CAA30168; Wed, 22 May 2002 02:14:25 +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 CAA30179 for ; Wed, 22 May 2002 02:14:24 +0200 (MET DST) Received: from hotmail.com (f218.law8.hotmail.com [216.33.241.218]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4M0ENX04373 for ; Wed, 22 May 2002 02:14:23 +0200 (MET DST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 21 May 2002 17:14:22 -0700 Received: from 68.82.51.136 by lw8fd.law8.hotmail.msn.com with HTTP; Wed, 22 May 2002 00:14:21 GMT X-Originating-IP: [68.82.51.136] From: "Ryan Tarpine" To: ctchou@mipos2.intel.com, caml-list@inria.fr Subject: Re: [Caml-list] Weird typing problem Date: Tue, 21 May 2002 20:14:21 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 22 May 2002 00:14:22.0228 (UTC) FILETIME=[9F90CD40:01C20125] Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >From: Ching-Tsun Chou >To: caml-list@inria.fr >Subject: Re: [Caml-list] Weird typing problem >Date: Tue, 21 May 2002 16:58:32 -0700 (PDT) > >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 >------------------- See http://caml.inria.fr/FAQ/FAQ_EXPERT-eng.html#polymorphisme. In short, (quoted from the FAQ) When type-checking let name = expr1 ... The type of expr1 is generalized when expr1 is a function, an dentifier or a constant. Otherwise the identifier name is not polymorphic (type variables are not generalized). ... The new rule implies that if expr1 is a function application, then the identifier name is monomorphic This is done because "a secure type system for Caml must forbid the existence of polymorphic mutable values at run-time" and this was basically the easiest way to do it. Read the FAQ for an example. HTH, Ryan Tarpine, rtarpine@hotmail.com "To err is human, to compute divine. Trust your computer but not its programmer." - Morris Kingston _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com ------------------- 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