From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id F3C6FBB91 for ; Wed, 26 Jan 2005 17:00:16 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0QG0GpB024656 for ; Wed, 26 Jan 2005 17:00:16 +0100 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 RAA13391 for ; Wed, 26 Jan 2005 17:00:16 +0100 (MET) Received: from alex.barettalocal.com (h213-255-109-130.albacom.net [213.255.109.130] (may be forged)) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j0QG0FFA027896 for ; Wed, 26 Jan 2005 17:00:16 +0100 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by alex.barettalocal.com (Postfix) with ESMTP id 3423A2BBABF for ; Wed, 26 Jan 2005 17:00:16 +0100 (CET) Message-ID: <41F7BE8F.5090101@barettadeit.com> Date: Wed, 26 Jan 2005 17:00:15 +0100 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1 X-Accept-Language: it, en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] 'a Set? 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> In-Reply-To: <20050126.210400.42882977.garrigue@math.nagoya-u.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41F7BE90.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41F7BE8F.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; baretta:01 caml-list:01 wrote:01 semantics:01 hashtbl:01 trivial:01 printf:01 kprintf:01 failwith:01 baretta:01 exception:01 signatures:01 jacques:01 patterns:02 parameter:02 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: 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