On Sun, 25 Jan 2015 00:12:18 +0000, Dominikus Dittes Scherkl wrote: > On Saturday, 24 January 2015 at 23:19:11 UTC, ketmar wrote: >> people that are new to D aren't used to D lambdas, so it's fairly >> common. > Oh, I am aware, but I didn't thought it would be necessary in this pace. > >> if you'll stay with D, you'll find yourself dreaming about such handy >> thing in another compiled languages very soon. ;-) > > I don't consider to use any other language as long as I have a choice > :-) > > But in the end, my one short and beautiful solution > > auto myRange = iota(start, end).map!foo; > > changed into something quite klumsy: > > auto myRange = iota(start, end).map!(x => > foo(cast(ParameterTypeTuple!foo[0])x)); > > which I think is against the philosophy of D as it turns away the eye of > the reader from what is really going on, especially if previous > constraints ensured that start and end-1 are of the correct type :-( > > But ok, still far, far better than what would be neccessary in C++
you can always write your own iota replacement, which will do "[]" and use ubytes, for example. writing that things is way easier than in C++. something like "myIota!ubyte(0, 255)", for example -- to make it visible that it emits ubytes.
signature.asc
Description: PGP signature