English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Custom operators in the revised syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-13 (07:36)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Custom operators in the revised syntax
On Sat, 2007-05-12 at 22:52 -0700, brogoff wrote:
> On Sun, 13 May 2007, Nicolas Pouillard wrote:
> > I've a tiny patch to do that:
> >
> > 2 ``List.mem`` [1;2;3]
> >
> > I think that extension harmless, any thoughts?
> That looks like a good start. This patch is in the new Revised?

There was a discussion on this previously, and it can be
done now with ordinary Ocaml, no camlp4 needed, and it
can be done much better than the weak Haskell formulation.

The idea is something like:

	a <+ b +> c

translates to

	b a c

however this formulation not only allows 'b' to be an arbitrary
expression, but also supports nesting. The operators are not
the ones I listed though .. perhaps someone can search the archives
of this mailing list to find the previous discussion.

Exactly how the Revised syntax would support this I don't know,
however I really think Revised should be thrown out ;(

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net