From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=AWL,NO_REAL_NAME autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id DFEE0BC0A for ; Sun, 13 May 2007 17:56:14 +0200 (CEST) Received: from server2.thinkcrime.de (server2.thinkcrime.de [213.133.110.149]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4DFuEiL002986 for ; Sun, 13 May 2007 17:56:14 +0200 Received: from hod-sarge-2005-10.lan.m-e-leypold.de (dslb-088-072-224-076.pools.arcor-ip.net [88.72.224.76]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server2.thinkcrime.de (Postfix) with ESMTP id A7AE648800D for ; Sun, 13 May 2007 17:56:12 +0200 (CEST) Received: by hod-sarge-2005-10.lan.m-e-leypold.de (Postfix, from userid 1003) id B15DD37BC9; Sun, 13 May 2007 18:04:45 +0200 (CEST) To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Custom operators in the revised syntax References: <200705111537.32561.jon@ffconsultancy.com> <200705120348.50308.jon@ffconsultancy.com> <1178944803.14691.28.camel@rosella.wigram> <20070512102254.GA862@furbychan.cocan.org> <464731DE.5070002@lix.polytechnique.fr> Organization: Leypold, Software-Dienstleistungen und -Beratung From: ls-ocaml-developer-2006@m-e-leypold.de Date: Sun, 13 May 2007 18:04:45 +0200 In-Reply-To: <464731DE.5070002@lix.polytechnique.fr> (Arnaud Spiwack's message of "Sun, 13 May 2007 17:42:22 +0200") Message-ID: User-Agent: Some cool user agent (SCUG) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at discorde with ID 4647351E.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 lix:01 coq:01 usefull:01 notation:01 infix:01 infix:01 notation:01 overloading:01 usefull:01 ocaml:01 foo:01 foo:01 markus:01 arnaud:01 Arnaud Spiwack writes: > About that, Coq uses something that proved itself to be rather > usefull, though the problematic is a bit different. It's called > notation scopes. The idea is that infix operators are defined in a > specific scope. That you can either open locally using (here the scope > is open)%scopeName, or globally by using Open Scope scopeName. When a > scope is open, all the infix operators are interpreted as its > definition in that scope. There are also a few more technicalities to > make it even more fun (for instance, you can bind a scope to a type t, > then, whenever an expression is inferred to be type t, the scope t is > automatically opened, it's a very useful feature). > > This allows a milde, but rather usable notation overloading. > > I've been wondering for quite a while if such a policy would be > reasonable/usefull for OCaml. I'd like to have a way to open moduls in a restricted scop, like with module Foo let x = f a b c in ... end which would be equivalent to let x = Foo.f a b c in ... if f is in Foo. Regards -- Markus