From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 38119BC8D for ; Wed, 26 Jan 2005 22:09:29 +0100 (CET) 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 j0QL9S2a002985 for ; Wed, 26 Jan 2005 22:09:28 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA25108 for ; Wed, 26 Jan 2005 22:09:28 +0100 (MET) Received: from us18.unix.fas.harvard.edu (us18.unix.fas.harvard.edu [140.247.35.198]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0QL9R7M025814 for ; Wed, 26 Jan 2005 22:09:28 +0100 Received: from [140.247.161.153] (roam161-153.student.harvard.edu [140.247.161.153]) by us18.unix.fas.harvard.edu (8.12.11/8.12.11) with ESMTP id j0QL9PjE003013; Wed, 26 Jan 2005 16:09:25 -0500 In-Reply-To: <41F7BE8F.5090101@barettadeit.com> References: <16887.21524.707176.646417@gargle.gargle.HOWL> <001401c5038f$c0ad0ba0$0100a8c0@mshome.net> <7f8e92aa05012603042437cf1c@mail.gmail.com> <20050126.210400.42882977.garrigue@math.nagoya-u.ac.jp> <41F7BE8F.5090101@barettadeit.com> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <8E480565-6FDE-11D9-8411-0003939A19AA@fas.harvard.edu> Content-Transfer-Encoding: 7bit Cc: caml-list@inria.fr From: Mike Hamburg Subject: Re: [Caml-list] 'a Set? Date: Wed, 26 Jan 2005 16:09:24 -0500 To: Alex Baretta X-Mailer: Apple Mail (2.619) X-Miltered: at concorde with ID 41F80708.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41F80707.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 mylist:01 toplevel:01 baretta:01 wrote:01 wrote:01 semantics:01 hashtbl:01 trivial:01 printf:01 kprintf:01 failwith:01 baretta:01 caml-list:01 beginner's:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: I call this operator , because I often use it like so: List.map (List.nth 3) myList;; Sadly, at toplevel makes you lots of pretty '_a that restrict your future actions. See my next post for questions about '_a. Mike On Jan 26, 2005, at 11:00 AM, Alex Baretta wrote: > Jacques Garrigue wrote: >> From: Radu Grigore > >> If you respect this convention, the type tells you about the semantics >> :-) > > There are two different patterns for function signatures: the Hashtbl > pattern and the Map pattern. Both are "good", depending on the > context. Since I need both approaches I have come up with a little > trick to get the best of both worlds. > > # let (~%) f = fun x y -> f y x > > The ~% operator swaps the first and the second parameter in a function > call. The following is a trivial example of its use. > > # ~% Printf.kprintf "Hello %s!" failwith "World";; > Exception: Failure "Hello World!". > > Alex > > -- > ********************************************************************* > http://www.barettadeit.com/ > Baretta DE&IT > A division of Baretta SRL > > tel. +39 02 370 111 55 > fax. +39 02 370 111 54 > > Our technology: > > The Application System/Xcaml (AS/Xcaml) > > > The FreerP Project > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >