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 OAA02175; Fri, 14 Sep 2001 14:55:58 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 OAA02085 for ; Fri, 14 Sep 2001 14:55:57 +0200 (MET DST) Received: from moutvdom00.kundenserver.de (moutvdom00.kundenserver.de [195.20.224.149]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f8ECtqr23234 for ; Fri, 14 Sep 2001 14:55:57 +0200 (MET DST) Received: from [195.20.224.204] (helo=mrvdom00.schlund.de) by moutvdom00.kundenserver.de with esmtp (Exim 2.12 #2) id 15hsVW-0006kM-00 for caml-list@inria.fr; Fri, 14 Sep 2001 14:55:46 +0200 Received: from drms-3e364b5a.pool.mediaways.net ([62.54.75.90] helo=ice.gerd-stolpmann.de) by mrvdom00.schlund.de with esmtp (Exim 2.12 #2) id 15hsVV-0005tz-00 for caml-list@inria.fr; Fri, 14 Sep 2001 14:55:45 +0200 Received: from localhost (localhost [[UNIX: localhost]]) by ice.gerd-stolpmann.de (8.9.3/8.9.3) id OAA28337 for caml-list@inria.fr; Fri, 14 Sep 2001 14:55:30 +0200 From: Gerd Stolpmann Reply-To: info@gerd-stolpmann.de Organization: privat To: caml-list@inria.fr Subject: Re: [Caml-list] function vs. parser Date: Fri, 14 Sep 2001 14:50:24 +0200 X-Mailer: KMail [version 1.0.29.2] Content-Type: text/plain References: In-Reply-To: MIME-Version: 1.0 Message-Id: <01091414551800.23904@ice> Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 13 Sep 2001, Krishnaswami, Neel wrote: >Anyway, for some Caml-related content, is there a way to use qualified >paths and infix notation together? > >I mean, if I have: > > module Foo = struct let (+++) x y = List.append x y end > >Right now I have to write > > Foo.(+++) [1; 2] [3; 4] > >Is there any way I can write something like > > [1; 2] Foo.+++ [3; 4] > >without using open or rebinding the Foo module's function in the local >namespace? As far as I know, it is not possible. As a workaround, I use sometimes a submodule only for operators: module Foo = struct let foo x y = ... module Operators = struct let (+++) = foo end end So you can open only the Foo.Operators module, and have more control over the namespace. Gerd -- ---------------------------------------------------------------------------- Gerd Stolpmann Telefon: +49 6151 997705 (privat) Viktoriastr. 45 64293 Darmstadt EMail: gerd@gerd-stolpmann.de Germany ---------------------------------------------------------------------------- ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr