Food for thought

Dave Dave_member at pathlink.com
Wed Feb 14 07:02:24 PST 2007


Don Clugston wrote:
> Dave wrote:
>> Don Clugston wrote:
>>> Robby wrote:
>>>> The implementation of array methods to me is one of the sexiest, and 
>>>> yet quietest features of D. Probably do to the duh factor, but none 
>>>> the less. (any method that has an array as the first argument can 
>>>> use a shortened syntax)
>>>
>>> IIRC, it's quiet because it was originally a bug. Albeit a very 
>>> popular one. And that's why it only works in a peculiar subset of cases.
>>> Even for arrays, it doesn't work for operator overloading, 
>>> unfortunately.
>>> I wonder if Walter's worked out why it works <g>. (Mind you, the list of 
>>
>> I don't think it was ever unintentional: expression.c, line 4895 (v1.005)
> 
> OK, I've finally begun an Easter egg list <g>.
> 
> http://www.prowiki.org/wiki4d/wiki.cgi?EasterEggs
> 

Cool <g>

In the expression.c code above, there's mention that it should also work as something like:

array.foo.bar.baz.func(arg2); // foo.bar.baz.func(array,arg2);

I wonder if Walter's criteria for Easter Eggs is that they currently work, but there are some corner 
cases to solve yet?

> 
>>
>>> Easter eggs that have appeared in D is getting pretty impressive -- 
>>> maybe it's a half-implemented feature rather than a bug).
>>>
>>> It would indeed be fabulous if it worked all cases.



More information about the Digitalmars-d mailing list