Ok I got it

you mean

        "'snOOpy' capitalized
        >>>'Snoopy'"


        and not
        "'snOOpy' capitalized
        >>>'SnOOpy'"


Indeed.

Now captialized comment is clear.
We could do that in Pharo70 alpha.
Now for OS that distinguish S from s we should pay attention.

Stef

On Wed, 15 Mar 2017 11:33:35 +0100, Torsten Bergmann <[email protected]> wrote:

According to https://en.wikipedia.org/wiki/Capitalization

to "capitalize" is writing a word with its first letter as a capital letter (upper-case letter)
AND THE REMAINING LETTERS IN LOWER CASE writing systems.

So

  'SOMETHING' capitalized

currently returns "SOMETHING" in Pharo but should return "Something" according to the definition to end up with lowercase. If we fix this I guess we would also align Pharo with other languages, like C# for example [1].

Could be easily changed by replacing "copy" with "asLowercase" in #capitalized:

 capitalized
        "Return a copy with the first letter capitalized"
        | cap |
        self isEmpty ifTrue: [ ^self copy ].
        cap := self asLowercase.
        cap at: 1 put: (cap at: 1) asUppercase.
        ^ cap

Should we fix this? Do not know about any side effects...


Note: a) Squeak has the same issue
      b) it fits for #uncapitalized, see [2]
      c) Dont know about ANSI standard or any other ST dialect

Thx
T.


[1] https://github.com/srkirkland/Inflector/blob/master/Inflector.Tests/CapitalizeTests.cs [2] https://github.com/srkirkland/Inflector/blob/master/Inflector.Tests/UncapitalizeTests.cs



--
Using Opera's mail client: http://www.opera.com/mail/

Reply via email to