What features of D are you using now which you thought you'd never goint to use?

monarch_dodra monarchdodra at gmail.com
Sun Jun 23 04:34:24 PDT 2013


On Sunday, 23 June 2013 at 11:06:07 UTC, Joseph Rushton Wakeling 
wrote:
> On 06/23/2013 10:54 AM, monarch_dodra wrote:
>> Not quite, it returns an object that returns those items when 
>> iterated on. But
>> it is not the same type.
>
> Why does that matter to you?  One of the nice things about 
> ranges is that the
> strict object type seems to matter less than the interface and 
> the type that
> .front returns.  E.g. someRange.takeExactly(10) is not of the 
> same type as
> someRange, but I find that largely irrelevant when using it.
>
> Not intending to dismiss your concern, just curious to 
> understand your requirements.

That's a very "I have a range and want to iterate on it" view. 
Which is fine and it works in that case (and I have no problems 
there).

But as soon as you need an algorithm that actually *handles* 
ranges: swaps them, merges them, searches in them and splices 
them, then things get hairy.

For example, try implementing a sort (either merge or q) with a 
non-sliceable range... very very hard...


More information about the Digitalmars-d mailing list