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 BAA29612; Wed, 22 May 2002 01:48:08 +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 BAA29647 for ; Wed, 22 May 2002 01:48:07 +0200 (MET DST) Received: from hotmail.com (f113.law8.hotmail.com [216.33.241.113]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4LNm6X03285 for ; Wed, 22 May 2002 01:48:06 +0200 (MET DST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 21 May 2002 16:48:05 -0700 Received: from 68.82.51.136 by lw8fd.law8.hotmail.msn.com with HTTP; Tue, 21 May 2002 23:48:05 GMT X-Originating-IP: [68.82.51.136] From: "Ryan Tarpine" To: caml-list@inria.fr Subject: Re: [Caml-list] Weird typing problem Date: Tue, 21 May 2002 19:48:05 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 21 May 2002 23:48:05.0590 (UTC) FILETIME=[F3D0EF60:01C20121] Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >From: Ching-Tsun Chou To: pixel@mandrakesoft.com CC: >caml-list@pauillac.inria.fr Subject: Re: [Caml-list] Weird typing problem >Date: Tue, 21 May 2002 16:20:11 -0700 (PDT) > >Thanks! But I still fail to see why the compiler and the interpreter should >behave differently. > >- Ching Tsun 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). HTH, Ryan Tarpine, rtarpine@hotmail.com "To err is human, to compute divine. Trust your computer but not its programmer." - Morris Kingston _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx ------------------- 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