[nem-en] Re: Late Binding in Nemerle
Kamil Skalski
kamil.skalski at gmail.com
Tue Jul 4 20:05:13 CEST 2006
Ok, you are right that it is usually better to not apply late in
questionable situations. But still my intuitions is that if one
specify 'late' then it should expand to the whole expression.
I'm talking about late expr + expr vs late (expr) + expr vs
(late expr) + expr
My intuition is that late has very low precedence (it does not stick
only to the nearest expression, but to the whole one) and it captures
'expr + expr'.
Also, not that usually '(late expr) OP expr' does not make any
sense, since late always returns object and most operators do not take
object as parameter.
2006/7/4, Snaury <snaury at gmail.com>:
> On 7/4/06, Kamil Skalski <kamil.skalski at gmail.com> wrote:
> > I want it for the whole part of code and if I don't I just
> > use proper () to separate the expressions.
>
> Actually not! That's what I wanted it to be too! But unfortunately
> parentheses don't leave even a *slightest* trace in PExpr, everything
> up until ; or , is eaten and given for late macro. :(((
>
> That's why I had to strip : and :> operators first, then I suddenly
> found that other operators are given as a call, and like that. If
> someone can write a better syntax, I'm open to suggestions, but I just
> don't want to make it a complete mess, where late is applied to not
> where you expect (to me it is better if late is not applied in
> questinable situations)
>
> Currently there's actually another problem, if you write late(expr +
> expr), it as if you didn't have these parentheses. I guess I should
> return parentheses syntax, but only as late(late-expr) without
> anything after closing parenthese...
>
> > Especially the
> > late-expr <op> expr...
> >
> > rule is suprising for me... why left side, not right? ;)
>
> Because usually it is written as late expr + expr. I wanted "weight"
> of late be as little as possible, so late is applied only to the left
> side and not to the right.
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list