February 10, 2017
On Friday, 10 February 2017 at 09:25:04 UTC, Daniel Kozak wrote:
>> Now I tried this with a named instead of a magic constant e.g.
>>
>>> immutable VALUE=-1;
>>> arr.each!"a[]=VALUE";
>>
>> And it doesn't work anymore. I've no clue, why... Can you help me?
> Because it does not see VALUE, you need to use delegate insted of string something like this:
>
> arr.each!(a=>a[]=VALUE);

Unfortunately this leeds to the same error... (Or something very simmilar.)


February 10, 2017
On Friday, 10 February 2017 at 09:34:39 UTC, berni wrote:
> On Friday, 10 February 2017 at 09:25:04 UTC, Daniel Kozak wrote:
>>> Now I tried this with a named instead of a magic constant e.g.
>>>
>>>> immutable VALUE=-1;
>>>> arr.each!"a[]=VALUE";
>>>
>>> And it doesn't work anymore. I've no clue, why... Can you help me?
>> Because it does not see VALUE, you need to use delegate insted of string something like this:
>>
>> arr.each!(a=>a[]=VALUE);
>
> Unfortunately this leeds to the same error... (Or something very simmilar.)

Opps, sorry. Taking back everything. It was a typo, that caused the error.
1 2
Next ›   Last »