Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] Custom operators in the revised syntax
On 5/13/07, Christian Stork <cstork@ics.uci.edu> wrote:
> On Sun, May 13, 2007 at 02:27:34AM +0200, ketti wrote:
> > On 5/13/07, Nicolas Pouillard <nicolas.pouillard@gmail.com> wrote:
> >
> > >I've a tiny patch to do that:
> > >
> > >2 ``List.mem`` [1;2;3]
> > >
> > >I think that extension harmless, any thoughts?
> >
> >
> > What about: 2 ´List.mem´ [1;2;3] ?

This character is plain ascii?

> Or:
>     2 `(List.mem) [1;2;3]

I prefer something more balanced.

> Then you could even have operators with arguments.  IIRC this idea (not
> this particular syntax) was proposed for Haskell' but wasn't worth the
> effort to make work with their current `single-op` syntax.  Maybe it's
> worth it in this case?

That's already supported even nesting if you put parens.

x ``f y`` z  ~~~> f y x z

x ``(y ``f`` z)`` t ~~~> f y z x t

-- 
Nicolas Pouillard