NotNull pointers

Simen Kjaeraas simen.kjaras at gmail.com
Wed Aug 31 15:26:44 PDT 2011


On Wed, 31 Aug 2011 23:54:04 +0200, Timon Gehr <timon.gehr at gmx.ch> wrote:

>> [2 * x ; x <- iota(10), log(x), x*x > 4]
>>
>> or, in a library:
>>
>> compr!q {2 * x ; x <- iota(10), log(x), x*x > 4};
>>
>>
>
> compr!q{2 * x ; x <- iota(10), log(x), x*x > 4};

The library solution has problems with scope variables. Example:

auto foo(Range)(int n, Range r) {
     return compr!q{x * n; x <- arr, log(x), x*x > 4};
}

More importantly, IMO, is that the notation does not clearly
mark what is what. is that interpreted (iota(10), log(x))
or (log(x), x*x > 4)?

-- 
   Simen


More information about the Digitalmars-d mailing list