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 XAA24600; Thu, 13 Sep 2001 23:45:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 XAA24231 for ; Thu, 13 Sep 2001 23:45:46 +0200 (MET DST) Received: from smtp1.cswv.com (smtp1.cswv.com [4.17.129.17]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8DLjjP00640 for ; Thu, 13 Sep 2001 23:45:45 +0200 (MET DST) Received: from smtp1.cswv.com ([4.17.129.17]) by smtp1.cswv.com with Microsoft SMTPSVC(5.5.1877.197.19); Thu, 13 Sep 2001 17:46:08 -0400 Received: FROM exchange1.cswv.com BY smtp1.cswv.com ; Thu Sep 13 17:46:08 2001 -0400 Received: by exchange1.cswv.com with Internet Mail Service (5.5.2653.19) id ; Thu, 13 Sep 2001 17:49:44 -0400 Message-ID: From: "Krishnaswami, Neel" To: caml-list@inria.fr Subject: Re: [Caml-list] function vs. parser Date: Thu, 13 Sep 2001 17:49:44 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Brian Rogoff [mailto:bpr@best.com] wrote: > On Thu, 13 Sep 2001, Krishnaswami, Neel wrote: > > > > Yeah, it's a convention, since types are first-class values > > in Dylan. Such conventions are easy to create in Dylan because > > it's way permissive about which characters are legal in identifiers > > than most languages are -- almost all punctuation is legal. This > > produces a different set of complaints, though: people are unhappy > > that they have to write "foo + bar", because "foo+bar" is a distinct > > identifier. > > This is a good thing IMO. The only exceptions of course being > things like (), ;, and ",". I agree with you, but the sheer volume is astounding. If I were a language designer, I'd strongly consider restricting identifiers to [a-zA-Z0-9_] just to keep the noise level down! It sucks, but in a traditional way. :) > > > Maybe in a post-Unicode world everything will be OK. > > I guess I really should have put a :-) there, huh? Probably -- I've seen too many people seriously propose this to read it as a joke anymore. > > Doesn't Caml use such a convention to set the precedence of infix > > functions, so that *.. has higher precedence that +..? > > Yes, be careful with | vs || and stuff like that with infixes. I got > burned there recently. Doh! Ooh, that's nasty. > > I think that's pretty neat actually. I find it much more readable > > than Haskell's `backquote` mechanism. > > But you can use names with backquotes. That's -why- I find it more readable. Simple juxtaposition is usually left-to-right function application, with the exception that things made of nonalphabetic characters are infix. Seeing something like x `frob` y is really hard for me to read, since I want to read it as the function x taking two arguments. But maybe this just takes a little more practice than I've had. 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? -- Neel Krishnaswami neelk@cswcasa.com ------------------- 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