DMD 0.170 release

Bill Baxter wbaxter at gmail.com
Wed Oct 18 13:55:48 PDT 2006


Oskar Linde wrote:
> Bill Baxter wrote:
> 
>> Oskar Linde wrote:
>>
>>> Walter Bright wrote:
>>>
>>>> Bill Baxter wrote:
>>>>
>>>
>>> foreach(x; "abcd".reverseView())
>>>     writef("%s",x);
>>>
>>> prints "dcba"
>>>
>>> For any type of built in array for a very long time (long before 
>>> 0.170), and it certainly seems to work for me.
>>
>>
>> How do you do that?  I just get
>> : undefined identifier reverseView
>> : function expected before (), not reverseView of type int
>> : cannot infer type for x
> 
> 
> Sorry. I wasn't very clear on this in my post. Here is a simple 
> implementation that runs:
> ...

Ok, I see.  Yeh, I just yesterday learned about this trick of defining 
methods for array classes (after I sent the message).  It's very well 
hidden in the spec. ;-)  Thanks for taking the time to make that example.

--bb



More information about the Digitalmars-d-announce mailing list