So how exactly does one make a persistent range object?

Jonathan M Davis jmdavisProg at gmx.com
Sun Jun 5 17:29:25 PDT 2011


On 2011-06-05 17:19, Andrej Mitrovic wrote:
> On 6/6/11, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> > I really don't think that Andrei was thinking that people would need to
> > save ranges when he started internalizing all of the range types in
> > std.range and std.algorithm.
> 
> There are some classes like InputRangeObject defined in std.range that
> might be used to store a general-purpose range, but they're annotated
> with some comments about various bugs they have. I gave that a try a
> while ago, but it's a pain to make it work at all.
> 
> Well.. D is a very compile-time-oriented language, as opposed to one
> that's focused more on runtime features. Nothing bad about that, but
> flexibility at runtime can be nice to have. Ranges seem to be focused
> on the programmer's needs, and not something you can let the user play
> with at runtime too much.

??? I'm afraid that I don't follow. Ranges are generally templated rather than 
polymorphic, so their types tend to need to be dealt with explicitly unless 
using auto. Is that what you mean by runtime features? Most everything about 
types in a statically-typed is a compile time issue. Polymorphism and runtime 
reflections are just about the only stuff which isn't. And do you mean the 
users of Phobos or the users of programs written in D? I'm afraid that I'm 
totally missing your train of thought here, so I'm not quite sure what you're 
trying to say.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list