Range of random numbers

Ali Çehreli acehreli at yahoo.com
Mon Apr 23 11:22:30 PDT 2012


On 04/23/2012 10:56 AM, Joseph Rushton Wakeling wrote:
> On 23/04/12 19:46, Joseph Rushton Wakeling wrote:
>> On 23/04/12 18:56, bearophile wrote:
>>> jerro:
>>>
>>>> return repeat(0).map!(_ => uniform(lower, upper))();
>>>>
>>
>> Yes, this works nicely. Thanks very much!
>
> Is this a new addition? With GDC I get a compiler error:
>
> expression expected, not '>'
>
> ... suggesting => isn't supported.
>

The lambda syntax was added in 2.058:

   http://dlang.org/changelog.html

Ali


More information about the Digitalmars-d-learn mailing list