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 EAA01891; Thu, 22 Aug 2002 04:05:05 +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 EAA01710 for ; Thu, 22 Aug 2002 04:05:03 +0200 (MET DST) Received: from corwin.mutu.net (mutu.net [80.65.226.162]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g7M252929828 for ; Thu, 22 Aug 2002 04:05:02 +0200 (MET DST) Received: by corwin.mutu.net (Postfix, from userid 1000) id A456215901E; Thu, 22 Aug 2002 04:04:24 +0200 (CEST) To: caml-list@inria.fr Subject: Re: [Caml-list] Calling a function with a self-defined type as argument References: X-face: '|!UPdE>Ot'L}nt?6Tf|'s{y%l~,+Yc5|p8A}ibew|_!vc48pPNPPx@7QA~$`$g=|yH*8sh9R]Xj1(CV7oUe>#/,t.(Z4F From: Dimitri Ara Date: 22 Aug 2002 04:04:24 +0200 In-Reply-To: Message-ID: <87y9azy7h3.fsf@corwin.mutu.net> User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Oliver Bandel a écrit : > (* > let _ = x Line "h0oifdaji oi" ;; > This last one does not work: => "This function is applied to too many arguments" > > let _ = x Line( "reuruhjf" ) ;; > This last one does not work: => "This function is applied to too many arguments" > > But it works in this way: > let _ = x (Line "reuruhjf") ;; > > WHY? (why *only* that?) > > At least the second example (with parantheses around the > Line's arguments) should work...?! > *) Because : (1) application is left associative. Thus `f x y' means `(f x) y' and `x Line ""' means `(x Line) ""'. (2) parentheses don't delimit the arguments of a function or a constructor but only fix the precedence of an expression. Thus f x (y) means f x y and `x Line ("")' means `x Line ""'. ------------------- 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