From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7FAFDBC9F for ; Thu, 11 Aug 2005 12:41:54 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j7BAfr8v009663 for ; Thu, 11 Aug 2005 12:41:54 +0200 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 MAA30847 for ; Thu, 11 Aug 2005 12:41:53 +0200 (MET DST) Received: from justus.rz.uni-saarland.de (justus.rz.uni-saarland.de [134.96.7.31]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j7BAfr5J009659 for ; Thu, 11 Aug 2005 12:41:53 +0200 Received: from uni-sb.de (uni-sb.de [134.96.7.230]) by justus.rz.uni-saarland.de (8.12.10/8.12.10) with ESMTP id j7BAfpr59132317 for ; Thu, 11 Aug 2005 12:41:52 +0200 (CEST) Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.252.31]) by uni-sb.de (8.13.4/2005060800) with ESMTP id j7BAfi88020258; Thu, 11 Aug 2005 12:41:44 +0200 (CEST) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.13.4/2005033000) with ESMTP id j7BAfh3A003055; Thu, 11 Aug 2005 12:41:44 +0200 (CEST) Received: from mail.st.cs.uni-sb.de (goscinny.cs.uni-sb.de [134.96.235.32]) by mail.cs.uni-sb.de (8.13.4/2005060800) with ESMTP id j7BAfhu6024045; Thu, 11 Aug 2005 12:41:43 +0200 (CEST) X-Authentication-Warning: mail.cs.uni-sb.de: Host goscinny.cs.uni-sb.de [134.96.235.32] claimed to be mail.st.cs.uni-sb.de Received: from [134.96.235.101] (jonagold.cs.uni-sb.de [134.96.235.101]) by mail.st.cs.uni-sb.de (Postfix) with ESMTP id 0A7421BE2D; Thu, 11 Aug 2005 12:41:43 +0200 (CEST) In-Reply-To: <07A35039-4D77-4F7B-B0CC-A0247FBA14D0@lrde.epita.fr> References: <7B0AADBE-23D8-4C63-ABE7-75360C874E13@lrde.epita.fr> <873bpi2tx7.wl%osiire@k8.dion.ne.jp> <42F9AEF4.20204@gaillourdet.net> <3d13dcfc0508100050347b8c75@mail.gmail.com> <07A35039-4D77-4F7B-B0CC-A0247FBA14D0@lrde.epita.fr> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: <33e9ca430f07c8e8c61bfabe70274b24@cs.uni-sb.de> Content-Transfer-Encoding: quoted-printable Cc: caml-list@inria.fr From: Christian Lindig Subject: Re: [Caml-list] right-associating infix application operator camlp4 extension Date: Thu, 11 Aug 2005 12:41:40 +0200 To: =?ISO-8859-1?Q?Qu=F4c_Peyrot?= X-Mailer: Apple Mail (2.622) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.1 (justus.rz.uni-saarland.de [134.96.7.31]); Thu, 11 Aug 2005 12:41:52 +0200 (CEST) X-AntiVirus: checked by AntiVir Milter 1.0.6; AVE 6.31.1.0; VDF 6.31.1.92 X-Miltered: at concorde with ID 42FB2B71.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42FB2B71.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lindig:01 lindig:01 caml-list:01 infix:01 strangely:01 associative:01 val:01 val:01 2005,:98 wrote:01 uni-sb:01 expression:01 int:01 int:01 seems:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Aug 11, 2005, at 5:04 AM, Qu=F4c Peyrot wrote: > Thanks a lot for the answers. > Strangely I couldn't find $ in this documentation, but > let ($) f x =3D f x > seems to work. This does not work; you need a right associative operator: # let ($) f x =3D f x;; val ( $ ) : ('a -> 'b) -> 'a -> 'b =3D # (-) 3 $ (/) 4 $ 2 ;; This expression has type int -> int but is here used with type int # let (@@) f x =3D f x;; val ( @@ ) : ('a -> 'b) -> 'a -> 'b =3D # (-) 3 @@ (/) 4 @@ 2 ;; - : int =3D 1 This is the right result for 3-(4/2)=3D1. -- Christian