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 SAA04092; Mon, 9 Apr 2001 18:24:11 +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 SAA04088 for ; Mon, 9 Apr 2001 18:24:10 +0200 (MET DST) Received: from hall.mail.mindspring.net (hall.mail.mindspring.net [207.69.200.60]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f39GO8f16958 for ; Mon, 9 Apr 2001 18:24:09 +0200 (MET DST) Received: from dylan (1Cust61.tnt6.tucson.az.da.uu.net [63.11.147.61]) by hall.mail.mindspring.net (8.9.3/8.8.5) with SMTP id MAA13451 for ; Mon, 9 Apr 2001 12:24:00 -0400 (EDT) Message-ID: <004101c0c111$960022d0$210148bf@dylan> From: "David McClain" To: References: <20010409113449.A19116@lakeland.eecs.harvard.edu> Subject: Re: [Caml-list] petty complaints Date: Mon, 9 Apr 2001 09:24:37 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Haskell allows to > use any identifier as a binary operator when it is placed in > backquotes: x `plus` y. These operators are often more readable than > the classic infix operator symbols. These terms have no associativity > and a low precedence, thus forcing to use parentheses. An > implementation would only affect the lexer and should not be too hard. > Would other people like this feature, too? Yes, indeed! I have implemented this in my NML which is a very simple language in comparison to OCaml, but it borrowed the OCaml Lex and Yacc as starting points. It was very easy to implement this feature and I tend to use it most often with integer divide, modulo, and the bit twiddling primitives, as in let x = y `mod` z in ... I also have a syntax for list and vector comprehensions, a la Haskell. Very convenient for terse programming, e.g., let x = [(a,b) |: a <- [1 .. 100], b <- 100 - a] in ... - DM ----- Original Message ----- From: "Christian Lindig" To: "Caml Mailing List" Sent: Monday, April 09, 2001 8:34 AM Subject: Re: [Caml-list] petty complaints > On Sun, Apr 01, 2001 at 09:26:59PM -0700, Brian Rogoff wrote: > > Another unrelated trifling question concerns the syntax of numerical > > literals. > > Now that the spring cleaning for OCaml's syntax (floats, labels, > constructors) is in full swing, here is my wish: Haskell allows to > use any identifier as a binary operator when it is placed in > backquotes: x `plus` y. These operators are often more readable than > the classic infix operator symbols. These terms have no associativity > and a low precedence, thus forcing to use parentheses. An > implementation would only affect the lexer and should not be too hard. > Would other people like this feature, too? > > -- Christian > > -- > Christian Lindig Harvard University - DEAS > lindig@eecs.harvard.edu 33 Oxford St, MD 242, Cambridge MA 02138 > phone: +1 (617) 496-7157 http://www.eecs.harvard.edu/~lindig/ > ------------------- > To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr