getNext

Mehrdad wfunction at hotmail.com
Mon Jul 9 13:21:16 PDT 2012


On Monday, 9 July 2012 at 19:52:04 UTC, Andrei Alexandrescu wrote:
> On 7/9/12 3:30 PM, Mehrdad wrote:
>> I agree. My alternative would be to abandon similar 'hasXYZ' 
>> stuff
>> (which doesn't convey the picture and looks hacky), and 
>> instead formally
>> define what those are, like I/O range. Sounds good/bad?
>
> You may want to just spell it clearly.
>
> So right now we have the notions:
>
> input range (well one-pass range)
> forward range
> bidirectional range
> random-access range
> output range
>
> coupled with the capability queries
>
> isInfinite
> hasAssignableElements
> hasLength
> ...
>
> The small set of ranges coupled with the capability queries 
> reflect the orthogonal or near-orthogonal nature of such.
>
> As far as I understand the above, you propose the notions:
>
> input range
> input range with assignable elements
> infinite input range
> infinite input range with assignable elements
> forward range
> forward range with assignable elements
> ...
>
> That seems pretty onerous, but then I can't derive other 
> meaning from your post.
>
>
> Andrei

that's not what I meant, but I think another solution is better 
anyway:

Why isn't transform taking in both an input and an output range 
in the first place? Of course they might be the same, but they 
don't have to be.


More information about the Digitalmars-d mailing list