[nem-en] list operations priorities

Kamil Skalski kamil.skalski at gmail.com
Fri Dec 22 23:42:46 CET 2006


I tried this change and there are a few breaking places in compiler
code itself... :(

They are like:
  str + "aa" :: str_list

and it seems like not that uncommon pattern. So I'm not as sure as
before that we should really do this. In general + should not be used
for lists as it is quite expansive (the same with + on strings
though), so maybe we should not change its priority to better support
lists than strings and numeric values?

2006/12/22, Kamil Skalski <kamil.skalski at gmail.com>:
> >        foo :: foo_list + bar :: bar_list
>
> Right, I think it should parse as:
>
> foo :: (foo_list + (bar :: bar_list))
>
> so :: should have higher left priority than +'s right priority:
> x + y :: z   --->    x + (y :: z)
>
> the opposite case does not make much difference, but a bit of
> performance gain with
> x :: y + z   --->  x :: (y + z)   being better than   (x :: y) + z
>
>
> --
> Kamil Skalski
> http://nazgul.omega.pl
>


-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list