[nem-en] Re: Late Binding in Nemerle

Kamil Skalski kamil.skalski at gmail.com
Wed Jul 5 08:11:27 CEST 2006


Yes, my intuition (and current heading in the Snaury's implementation)
is just that.
Additionally I think the syntax shortcuts may mean:
late  expr1 . expr2 + expr3 ... ;
-->
late (expr1 . expr2 + expr3 ... );

and

late { expr1; expr2 ; ... }
-->
{ late (expr1); late (expr2); ... }


2006/7/5, Arthur Peters <amp at singingwizard.org>:
> I have been looking at this thread and I've had some thoughts that may
> or may not be useful. BTW, I realized that some of this may not apply.
> See the last 2 paragraphs.
>
> Perhaps it could be a bit simpler: late(expr) where every operation in
> expr is late bound if possible. That way it is very clear what will be
> late bound and what will not. Also late(...) will always "return" object
> so where casting is needed will be clear. We could even make it illegal
> to put an expression in late(...) that cannot be completely late bound.
> That way everything in the late(...) is late bound and everything
> outside it not.
>
> I think this would be relatively simple to implement as all we would
> need to do is write a simple macro with no syntax and if non-late
> bindable expressions are illegal there would also be no need to handle
> passing those expressions through.
>
> macro late(expr)
> {
>         late_bind_all_expressions( expr );
> }
>
> I am generally against operator precedence tricks because it tends to be
> confusing. And in a case like this there is no standard to go by like
> there is for math operators, so any person reading the code who had
> never used the late macro could have a lot of trouble understanding
> exactly what is happening.
>
>
> I just realized that what I am talking about is probably already covered
> by the late { ... } syntax. And because everything is an expression in
> Nemerle you could write: def i = late{ o.Member() } :> int + 1
>
> However I thought since I had already written all this I may as well
> post my thoughts to add to the idea pool.
>
> -Arthur
>
>
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>


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



More information about the devel-en mailing list