From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA20489 for caml-red; Wed, 8 Nov 2000 18:18:40 +0100 (MET) 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 OAA23267 for ; Tue, 7 Nov 2000 14:33:40 +0100 (MET) Received: from dpt-info.u-strasbg.fr (dpt-info.u-strasbg.fr [130.79.6.1]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eA7DXdb11442 for ; Tue, 7 Nov 2000 14:33:39 +0100 (MET) Received: from lambda.u-strasbg.fr (lambda.u-strasbg.fr [130.79.90.63]) by dpt-info.u-strasbg.fr (8.9.3/8.9.3) with ESMTP id PAA22370; Tue, 7 Nov 2000 15:32:52 +0100 Received: from luther by lambda.u-strasbg.fr with local (Exim 3.16 #1 (Debian)) id 13t8zf-0008Qz-00; Tue, 07 Nov 2000 14:40:55 +0100 Date: Tue, 7 Nov 2000 14:40:55 +0100 To: Chris Hecker Cc: caml-list@inria.fr Subject: Re: anonymous function + lable bug? Message-ID: <20001107144055.C30034@lambda.u-strasbg.fr> References: <4.3.2.7.2.20001105044616.00ababc0@shell16.ba.best.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <4.3.2.7.2.20001105044616.00ababc0@shell16.ba.best.com>; from checker@d6.com on Sun, Nov 05, 2000 at 05:11:11AM -0800 From: Sven LUTHER Sender: weis@pauillac.inria.fr On Sun, Nov 05, 2000 at 05:11:11AM -0800, Chris Hecker wrote: > > Is this a bug? > > # let f = fun ~x -> x;; > val f : x:'a -> 'a = > > # let g = function ~x -> x;; > Characters 17-18: > Syntax error > > I thought these two were equivalent? No, function has only one argument, and can do more kind of polymorphism than fun which can take more than one argument as in : let f = fun x y z -> x + y + z f 5 6 7 evaluates to 18. I think the use of function is preferable over fun, which is there for compatibility reasons. not sure what the ~ does, i think it is one of the label stuffs. Try : # let f ~x = x ;; val f : x:'a -> 'a = Don't know why there is a problem with the above though. Friendly, Sven Luther