July 08, 2013
On Saturday, 6 July 2013 at 14:18:35 UTC, Andrei Alexandrescu wrote:
> Perfect! Adam, no more excuses :o).


Now I just have to decide what to actually write... I don't know, I think the OP code mostly speaks for itself and I don't even have much to add beyond it.
July 08, 2013
On Monday, 8 July 2013 at 14:15:40 UTC, Adam D. Ruppe wrote:
> Now I just have to decide what to actually write...

I wrote something but it is kinda meandering.

http://wiki.dlang.org/Dynamic_typing
July 09, 2013
On Saturday, 6 July 2013 at 00:21:54 UTC, Adam D. Ruppe wrote:
> // the second () is just because @property is broken
> writeln(Math.max()("12", 24)); // prints 24

With dynamic typing there's no way to tell if Math.max(12,24) is a method call or field delegate call. Javascript assumes it's member call and passes this pointer to the called function. When I implemented an object for javascript, I chose to detect if a called method is a field with delegate and forward the call to the delegate as per semantics of javascript.
July 09, 2013
On Tuesday, 9 July 2013 at 19:14:30 UTC, Kagamin wrote:
> With dynamic typing there's no way to tell if Math.max(12,24) is a method call or field delegate call.

The way my thing works is Math.max (or anything else) returns a ref var, and the (12,24) does opCall on it, which succeeds if the var is of type function.

bearophile recently posted a pull request by Kenji Hara IIRC that implements @property more correctly. If that gets pulled, this will be good.

In the little scripting language too, there's now a class declaration, that looks kinda like D, but it is actually just syntax sugar that assigns the declarations to the object, so there is no distinction there between a method and field - all "methods" are just delegates attached to the object.
1 2 3
Next ›   Last »