Performance penalty for using ranges

H. S. Teoh hsteoh at quickfur.ath.cx
Sun Aug 25 14:34:05 PDT 2013


On Sun, Aug 25, 2013 at 11:10:39PM +0200, monarch_dodra wrote:
> On Sunday, 25 August 2013 at 21:01:54 UTC, bearophile wrote:
> >>[* Hijacking of discussion: a while back I think I floated the
> >>idea of generalizing iota() with closed/open boundary conditions
> >>similar to those found in std.random.uniform; so e.g. you could
> >>do iota!"[]"(0, 10) and the upper bound would be included in the
> >>values returned.  Would be useful for cases like these.]
> >
> >Yes, it's a kind of necessary enhancement:
> >http://d.puremagic.com/issues/show_bug.cgi?id=10466
> >
> >Bye,
> >bearophile
> 
> If somebody were to implement this, I would *love* to review it.

If somebody were to attempt to implement this, I'd recommend taking this
issue into account as well:

	http://d.puremagic.com/issues/show_bug.cgi?id=10762

	(which is a generalization of:
	http://d.puremagic.com/issues/show_bug.cgi?id=6447)

I don't know if the total amount of changes would warrant rewriting iota
entirely in order to keep the complexity of the implementation minimal.

(The nice thing about D unittests is that rewriting code is much less
scary because if the unittests are complete enough, they will catch any
regressions right off the bat.)


T

-- 
WINDOWS = Will Install Needless Data On Whole System -- CompuMan


More information about the Digitalmars-d mailing list