[nem-en] Suggestion: chancge syntax of defining tuple type

Mark Haniford markhaniford at gmail.com
Tue Jan 30 22:46:48 CET 2007


Don't change the syntax.  Kamil is right.  It's confusing with function
declarations and it's already an established semi-standard with ML and its
derivatives.

On 1/30/07, Kamil Skalski <kamil.skalski at gmail.com> wrote:
>
> Well, I think it would be more confusing than x*y*z
> For example
>
> foo (x : (int,int), y : int) : (int,(int,string)) {
> }
>
> vs
>
> foo (x : int * int , y : int) :  int * (int * string) {
> }
>
> And it gets even worse when we consider (not yet available) matching
> in parameters:
>
> foo ((a,b) : (int,int), y : int) : (int, (int,string)) {
> }
>
> and additionally default values:
> foo (y, : int (a,b) = (1,2)) : (int, (int,string)) {
> }
>
> Maybe it is not absolutely bad, but for me less readable.
>
>
> 2007/1/30, vc <vc at rsdn.ru>:
> > To All... What about this suggestion?
> >
> > > > Kamil, maybe restrict syntax of "tuple type" by:
> > > > '(' Type [ ',' Type ]+ ')'
> > > > i.e. with necessarily round brackets.
> > > >
> > > > It's eliminate ambiguity between tuple type and multiplication, and
> make
> > > > syntax more intuitive.
> > > >
> > > > It is breaking change, but in my option it's a good change.
> > >
> > > It has been suggested a few times in the past. The current syntax
> > > borrows from ML and math, but I agree (int,string) is more intuitive.
> > > I don't have any strong opinion here.
> >
> > Or at least obligatory specify parentheses in tuple type definitions.
> >
> >
> > _______________________________________________
> > https://nemerle.org/mailman/listinfo/devel-en
> >
>
>
> --
> Kamil Skalski
> http://nazgul.omega.pl
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/pipermail/devel-en/attachments/20070130/28a53029/attachment.html


More information about the devel-en mailing list