On 1/8/23 12:42 AM, Qusatlegadus wrote:
auto s = 1234.to!string.map!q{a - '0'}.sum;
works fine.
but if i do an alias
alias comb = to!string.map!q{a - '0'}
Error: unknown, please file report on issues.dlang.org
What's wrong with this alias?
Aside from the problem with the
On Sunday, 8 January 2023 at 09:45:09 UTC, Krzysztof Jajeśnica
wrote:
## Simple explanation
`to!string` is a function expecting 1 argument, which you're
not providing in your alias. Convert your alias to a lambda
expression:
```D
alias comb = x => x.to!string.map!q{a - '0'}
```
A logical
On Sunday, 8 January 2023 at 05:42:46 UTC, Qusatlegadus wrote:
auto s = 1234.to!string.map!q{a - '0'}.sum;
works fine.
but if i do an alias
alias comb = to!string.map!q{a - '0'}
Error: unknown, please file report on issues.dlang.org
What's wrong with this
## Simple explanation
On Sunday, 8 January 2023 at 05:42:46 UTC, Qusatlegadus wrote:
What's wrong with this alias?
```d
import std;
alias comb = map!q{a - '0'};
void main()
{
auto s = 2234.to!string.map!q{a - '0'}.sum;
s.to!string.comb.sum.writeln;
// thiS works: "2"
}
```
SDB@79
auto s = 1234.to!string.map!q{a - '0'}.sum;
works fine.
but if i do an alias
alias comb = to!string.map!q{a - '0'}
Error: unknown, please file report on issues.dlang.org
What's wrong with this alias?