Too complicated code for generating a random string?

monarch_dodra monarchdodra at gmail.com
Sat Feb 23 07:56:07 PST 2013


On Saturday, 23 February 2013 at 14:28:28 UTC, Jens Mueller wrote:
> Can we have a generic function/code that is as efficient as 
> yours?

Well, for now, we have "map" (and "iota"). This usually covers 
enough ground, but there remains cases where it is sub-optimal.

What we would need is a "generate". Basically, a range that calls 
a function to generate the value of front on the fly. I've seen 
enough threads like this one that "abuse" iota/repeat/take/map 
(or sequence and recurrence for that matter), just to obtain a 
generic generator.

Let's just write Generator/generator.


More information about the Digitalmars-d mailing list