Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-05-01 Thread Richard Jones
For the record, here's a better version by bluestorm: http://bluestorm.info/camlp4/pa_matches.ml.html Rich. -- Richard Jones Red Hat ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Arch

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-27 Thread David Teller
I think this would be useful. However, you can already do it in a slightly more complex fashion. >From the top of my mind, with let ( /* ) f g = f g let ( */ ) f g x = g f x you can achieve 1 /* mem */ [1;2;3] with the added bonus that a C programmer will never be able to read your code :) Ch

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-27 Thread David Teller
We can do that in OCaml, actually. I've seen at least three versions of this in the Net, one of them by me. Plus it also works with streams, arrays, etc. Cheers, David On Sat, 2008-04-26 at 14:32 -0700, Arthur Chan wrote: > The python syntax goes further than just the "in" bit, in fact. They > c

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-26 Thread Andrej Bauer
Arthur Chan wrote: > That > said, there are some of us who feel that that the python infix syntax is > clearer, and as it corresponds more directly to the mathematical > notation, it is just as provably correct as the List.mem notation is. > If reusing "in" is a big deal, then maybe we could do "i

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-26 Thread Arthur Chan
As Till Crueger suggested, sometimes the infix syntax makes more sense. More than that, one of the intents of the original ML language was to create a language that was clear in its intents and *provably correct* (at least that was what I was taught in school. ocaml apparently isn't completely pro

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-26 Thread Till Crueger
On Sat, 26 Apr 2008 09:41:57 +0200, Richard Jones <[EMAIL PROTECTED]> wrote: I'm guessing that there will be ambiguity because you're wanting to add yet another meaning to the reserved word 'in'. However I'm not sure why you don't just use 'List.mem', or even: let mem = List.mem ;; mem 1

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-26 Thread Richard Jones
On Fri, Apr 25, 2008 at 01:37:47PM -0700, Arthur Chan wrote: > Would it be difficult to have python-like syntax for List.exists? Could we > add it to Hashtbl and Array too? I'm not too fond of python's general > sloppiness, but the (x in mylist) syntax seemed very pretty to me. At the > least, i

Re: [Caml-list] [OSR] Standard syntax extensions ? - voting

2008-04-25 Thread Stefano Zacchiroli
On Fri, Apr 25, 2008 at 05:15:00PM +0200, David Teller wrote: > Good idea. Would you handle this wiki ? Sure, here is the wiki page: http://wiki.cocan.org/osr/batteriesincluded Beside that, the wiki is self-handling :) Just point the people to it and kindly ask to add their favorite extension. Ch

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread Mike Lin
On Thu, Apr 24, 2008 at 11:49 AM, David Teller <[EMAIL PROTECTED]> wrote: > > camlp5... We're also not discussing original vs. revised syntax vs. twt > [yet], although if you consider that some extension would be much more > useful if rendered compatible with one of these syntaxes, please mention

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread Arthur Chan
Hey David, Would it be difficult to have python-like syntax for List.exists? Could we add it to Hashtbl and Array too? I'm not too fond of python's general sloppiness, but the (x in mylist) syntax seemed very pretty to me. At the least, it correspondes directly to mathematical syntax (x \in bla

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread Richard Jones
On Fri, Apr 25, 2008 at 06:59:50PM +0200, Berke Durak wrote: > That would allow people to easily write tools that examine object > files without relying on the unnecessarily britlle binary format. > At the very least you could open it in a text editor and see if > everything's OK inside, or simply

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread Gerd Stolpmann
Am Freitag, den 25.04.2008, 18:59 +0200 schrieb Berke Durak: > > > On Fri, Apr 25, 2008 at 10:24 AM, Richard Jones <[EMAIL PROTECTED]> > wrote: > On Thu, Apr 24, 2008 at 10:53:36PM +0200, Berke Durak wrote: > > We absolutely need a standard serialization solution. > > >

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread Berke Durak
On Fri, Apr 25, 2008 at 10:24 AM, Richard Jones <[EMAIL PROTECTED]> wrote: > On Thu, Apr 24, 2008 at 10:53:36PM +0200, Berke Durak wrote: > > We absolutely need a standard serialization solution. > > > > I'm thinking of Sexplib of course but it could be another one. The > reason > > it must be st

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread Peng Zang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ahh, sounds good. Thanks, Peng On Friday 25 April 2008 11:04:35 am David Teller wrote: > The current plans are to have two sets of extensions inside Batteries > Included: > * a few will be opened by default > * some others will just be part of the d

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread David Teller
If you want to work on patching the compiler itself, please get in touch with Edgar Friendly. He's getting some work done on that side. I'm more interested in libraries and camlp4. Cheers, David On Thu, 2008-04-24 at 18:02 +0100, Jon Harrop wrote: > Agreed. There are some glaring omissions, like

Re: [Caml-list] [OSR] Standard syntax extensions ? - voting

2008-04-25 Thread David Teller
Good idea. Would you handle this wiki ? Cheers, David On Fri, 2008-04-25 at 00:16 +0800, Stefano Zacchiroli wrote: > What about the following 2 phases: > 1) prepare a list of nominations, maybe as a page on cocanwiki > 2) vote on them using a Doodle poll -- David Teller Security of Distribute

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread David Teller
The current plans are to have two sets of extensions inside Batteries Included: * a few will be opened by default * some others will just be part of the distribution, with instructions in a common format, regarding how to activate & use them In either case, we will probably have a slightly customi

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread Peng Zang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday 24 April 2008 01:05:44 pm Dario Teixeira wrote: > Remember the recent thread about ocamlbuild+findlib+camlp4 and the OSR > about standardising naming conventions for syntax extensions [1]. Using > a special ocamlbuild plugin [2], the barri

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread Andrej Bauer
Consider these three options: (1) There is a "standard set" of syntax extensions which is not officially part of Ocaml distribution. (2) Official Ocaml syntax is extended with a conservative set of syntax extensions, maybe just "open in" and "try finally". (3) There is an unofficial, full blown

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread Richard Jones
On Thu, Apr 24, 2008 at 10:53:36PM +0200, Berke Durak wrote: > We absolutely need a standard serialization solution. > > I'm thinking of Sexplib of course but it could be another one. The reason > it must be standard is that it's difficult to provide > serialization/deserialization functions outs

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-25 Thread Richard Jones
On Thu, Apr 24, 2008 at 04:52:50PM +0100, John Whitington wrote: > On 24 Apr 2008, at 16:49, David Teller wrote: > >* what kind of syntactic sugar is absolutely missing from the > >language ? > > I'd like a keyword "matches", so I can write > > map (matches (0, _, _)) l > > rather than > > ma

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-24 Thread Berke Durak
We absolutely need a standard serialization solution. I'm thinking of Sexplib of course but it could be another one. The reason it must be standard is that it's difficult to provide serialization/deserialization functions outside the imlementation. So Sexplib should be a standard extension, or b

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-24 Thread Jon Harrop
On Thursday 24 April 2008 17:41:17 Martin Jambon wrote: > On Thu, 24 Apr 2008, David Teller wrote: > > * which syntax extensions do you use so often that you consider they > > should be part of the language ? > > None because it creates unneeded dependencies between unrelated > libraries. Agreed.

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-24 Thread Dario Teixeira
Hi, Thanks for your initiative, David! > * which syntax extensions do you use so often that you consider they > should be part of the language ? Though there are a few so useful (open_in, list comprehensions) they can almost be considered "standard", I still don't think their inclusion by defaul

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-24 Thread Martin Jambon
On Thu, 24 Apr 2008, David Teller wrote: * which syntax extensions do you use so often that you consider they should be part of the language ? None because it creates unneeded dependencies between unrelated libraries. The problem is that software packages can only grow or be replaced because

Re: [Caml-list] [OSR] Standard syntax extensions ? - voting

2008-04-24 Thread Stefano Zacchiroli
On Thu, Apr 24, 2008 at 05:49:42PM +0200, David Teller wrote: > * which syntax extensions do you use so often that you consider they > should be part of the language ? Thanks for raising this up again. I'm not going to make my nominations with this post, but rather a methodological suggestion. Ma

Re: [Caml-list] [OSR] Standard syntax extensions ?

2008-04-24 Thread John Whitington
On 24 Apr 2008, at 16:49, David Teller wrote: * what kind of syntactic sugar is absolutely missing from the language ? I'd like a keyword "matches", so I can write map (matches (0, _, _)) l rather than map (function (0, _, _) -> true | _ -> false) l Had anyone done that or similar in caml

[Caml-list] [OSR] Standard syntax extensions ?

2008-04-24 Thread David Teller
Dear list, Now that the forge is up, it's time to (re)start thinking about the OSR and what we want the future of the OCaml standard distribution to look like. Other threads will be (re)spawned regarding various aspects of that distribution, but for now, I'd like to discuss which syntax exten