On Friday, 24 August 2018 at 15:18:13 UTC, Peter Alexander wrote:
I can write scaleAll like this:

auto scaleAll(int[] xs, int m) @nogc {
  return repeat(m).zip(xs).map!(mx => mx[0] * mx[1]);
}

So that repeat(m) stores m, but it is quite hacky to work like this.

Here's a spoonful of sugar to help that go down easier:

https://run.dlang.io/is/8lTmZg

Reply via email to