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

Andrey Khropov andrey.khropov at gmail.com
Wed Jan 31 00:34:25 CET 2007


vc wrote:

> > 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.
> 
> x : A * B - is non intuitive

Actually it comes from a mathematical notation of a cartesian product on sets
(http://ru.wikipedia.org/wiki/Прямое_произведение_множес
тв , http://en.wikipedia.org/wiki/Cartesian_product) which is usually denoted
with '×' symbol. It's in Unicode but it doesn't present on a standard keyboard
so it's not that handy to type.

> and ambiguity with multiplication:
> 
> def B = 2;
> def x = 2L;
> def y = x :> int * B;
> 
> But, if introduce mode strictly syntax (with round brackets) it will be
> correct code.

More round brackets lead to more code clutter. 
And they also could be confused with tuple constructors as well:

I think in such expressions as 'def y = x :> int * B;' should be always
resolved in favor of tuple type specification.

So '*' can be just considered like an operation on types with a high priority.
I don't think than that's counterintuitive.

-- 
AKhropov




More information about the devel-en mailing list