std.uni.toLowerCase / .toUpperCase

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 24 06:43:48 PDT 2015


On Wednesday, 24 June 2015 at 13:31:00 UTC, Jacob Carlborg wrote:
> How will that make things better? A user will see both toLower 
> and toLowerCase can think: "What the h*ll is the difference 
> between these to functions".

Absolutely.

I don't even like names that are just kinda similar. Ruby, for 
example, has `chop` and `chomp`. What's the difference? idk, I 
have to look it up. (chop will also remove non-newlines from the 
end)


At least toLower vs toLowerCase would have different types, so 
the compiler can help explain which is which, but really, ugh.


BTW here's another outside-the-box idea.

eager = toLower
lazy = map!lowercase


Yes, just provide a function that works on chars and reuse map 
for laziness.


More information about the Digitalmars-d mailing list