Re: what wrong with this alias

2023-01-09 Thread Steven Schveighoffer via Digitalmars-d-learn
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

Re: what wrong with this alias

2023-01-08 Thread Salih Dincer via Digitalmars-d-learn
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

Re: what wrong with this alias

2023-01-08 Thread Krzysztof Jajeśnica via Digitalmars-d-learn
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

Re: what wrong with this alias

2023-01-08 Thread Salih Dincer via Digitalmars-d-learn
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

what wrong with this alias

2023-01-07 Thread Qusatlegadus via Digitalmars-d-learn
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?