toLower

FeepingCreature feepingcreature at gmail.com
Wed Aug 16 05:40:09 UTC 2023


On Tuesday, 15 August 2023 at 20:09:28 UTC, Joel wrote:
> On Tuesday, 15 August 2023 at 16:54:49 UTC, FeepingCreature 
> wrote:
>> But does *not* import `std.ascii`! So there's no ambiguity 
>> inside the `sort` string expression between the two `toLower` 
>> functions..
>
> How do I get it to work?
>
> I tried std.ascii.toLower. And using alias 
> toLower=std.ascii.toLower;

To elaborate more, `toLower` doesn't work because function-scope 
aliases are not considered for UFCS.

```
     alias toLower = std.ascii.toLower;

     ...
     // So this does actually work:
         .map!toLower
     // but this does not, because it looks for a UFCS-capable 
symbol
         .map!(c => c.toLower)
     // but this does again
         .map!(c => toLower(c))

```



More information about the Digitalmars-d-learn mailing list