File.byLine should return dups?

Steven Schveighoffer schveiguy at yahoo.com
Sat Jun 5 18:00:57 PDT 2010


On Fri, 04 Jun 2010 16:04:56 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> On 06/04/2010 02:58 PM, Graham Fawcett wrote:
> [snip]
>> Thanks for the response. Yes, it makes mode to favour performance for
>> the common case, and as you say it's not hard to resolve this issue.
>>
>>> Now, that being said, a nice addition would be to create a duper range
>>> that allows you to do one expression:
>>>
>>> foreach(char[] line; retro(array(duper(f.byLine()))))
>>
>> Yes -- duper (and iduper) for the win! Great idea.
>
> I wonder what we can do to automatically reject such programs.

Train people that being given a mutable buffer does not mean you own it? :)

Seriously though, it's just something you learn.  I don't think there's  
anything the compiler can do to help.

-Steve


More information about the Digitalmars-d mailing list