[nem-en] Associativity of :> operator
Kamil Skalski
kamil.skalski at gmail.com
Sun Jan 28 21:43:57 CET 2007
Yeah, that would be nice. Unfortunately we have a nasty priorities
conflict in the other place:
def f (x : int) { (x,x) }
def x = f :> int -> int * int;
def y = 1 * (1 : object) :> int;
As you can see here, :> must have higher priority than * on the
left (to make second cast as 1 * (1:object) :> int) instead of (1
* (1:object)) :> int) and lower on the right (so we have f :> (int
-> int * int))
This, connected with constraints on * priorities, implies that left
priority of :> is higher than its right priority, thus assiciativity
is on the right, which in practice means no assiciativity at all.
2007/1/28, Vladimir Reshetnikov <v.reshetnikov at gmail.com>:
> Why associativity of :> operator is not defined here
> (http://nemerle.org/Operators) ?
> Now it looks like to be right-associative.
> I think, it should be left-associative.
>
> def x = 1;
> def y = x :> Int16 :> Int64;
>
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list