toLower

bachmeier no at spam.net
Tue Aug 15 20:26:49 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:
>> On Tuesday, 15 August 2023 at 16:47:36 UTC, Joel wrote:
>>>[...]
>> When you pass a string to a lambda, it's evaluated in 
>> `std.functional.unaryFun`/`binaryFun`.
>>
>> At that point, these modules are imported for use in string 
>> expressions:
>>
>> ```
>> import std.algorithm, std.conv, std.exception, std.math, 
>> std.range, std.string;
>> import std.meta, std.traits, std.typecons;
>> ```
>>
>> And `std.string` itself publically imports:
>>
>> ```
>> public import std.uni : icmp, toLower, toLowerInPlace, 
>> toUpper, toUpperInPlace;
>> ```
>>
>> 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;

Changing your map line to

```
.map!(c => std.uni.toLower(c))
```

works for me.


More information about the Digitalmars-d-learn mailing list