On Wed, 31 Aug 2011 23:54:04 +0200, Timon Gehr <timon.g...@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

Reply via email to