[Issue 4085] Steps toward a static foreach

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 25 17:09:10 PDT 2013


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



--- Comment #7 from bearophile_hugs at eml.cc 2013-07-25 17:09:08 PDT ---
(In reply to comment #4)

> Copy pasting a proposed implementation from 10712. Pretty much the same thing,
> but also handles indiscriminate types. It passes the prior tests, as well as
> handles the useage with doubles, or chars:

Just a reminder: elsewhere I asked for an improvement to iota(), to let it
optionally accept a string (like std.random.uniform) that allows to generate
complete intervals of a type or handy closed intervals:

iota!"[]"('a', 'z')
iota!"[]"(cast(ubyte)0, cast(ubyte)255)

Currently I think it's impossible to generate the full range of a type like
ubyes with iota, and it's not handy to generate the complete range of lowercase
char letters, you need to use iota('a', '{'), that currently doesn't work for
other reasons.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list