'From Squeak3.8alpha of ''17 July 2004'' [latest update: #6208] on 19 September 2004 at 3:21:21 pm'! "Change Set: withFirstCharDS-md Date: 19 September 2004 Author: Marcus Denker Peace Jerome reported a bug: #Will withFirstCharacterDownshifted raises an error. (Date Posted: 13 June 2004, Archive ID: 22847) This is an alternative fix that implements withFirstCharacterDownshifted to work the same like #capitalized. That is: Do not care about subclasse in the method implemented in String but provide a specializes method in Symbol instead. fixed to work with m17n"! !AbstractString methodsFor: 'converting' stamp: 'md 9/19/2004 15:19'! withFirstCharacterDownshifted "Return a copy with the first letter downShifted" | answer | self ifEmpty: [^ self copy]. answer _ self copy. answer at: 1 put: (answer at: 1) asLowercase. ^ answer. ! ! !StringTest methodsFor: 'testing - converting' stamp: 'md 8/10/2004 10:50'! testCapitalized | uc lc empty | uc := 'MElViN'. lc := 'mElViN'. empty := ' '. self assert: lc capitalized = uc. self assert: uc capitalized = uc. "the string gets copied" self deny: uc capitalized == uc. self deny: empty capitalized == empty.! ! !StringTest methodsFor: 'testing - converting' stamp: 'md 8/10/2004 10:45'! testWithFirstCharacterDownshifted | uc lc empty | uc := 'MElViN'. lc := 'mElViN'. empty := ' '. self assert: uc withFirstCharacterDownshifted = lc. self assert: lc withFirstCharacterDownshifted = lc. "the string gets copied" self deny: lc withFirstCharacterDownshifted == lc. self deny: empty withFirstCharacterDownshifted == empty.! ! !Symbol methodsFor: 'converting' stamp: 'md 8/10/2004 10:54'! withFirstCharacterDownshifted "Answer an object like the receiver but with first character downshifted if necesary" ^self asString withFirstCharacterDownshifted asSymbol.! ! !SymbolTest methodsFor: 'testing' stamp: 'md 8/10/2004 10:53'! testCapitalized | uc lc | uc := #MElViN. lc := #mElViN. self assert: lc capitalized = uc. self assert: uc capitalized = uc. ! ! !SymbolTest methodsFor: 'testing' stamp: 'md 8/10/2004 10:53'! testWithFirstCharacterDownshifted | uc lc empty | uc := #MElViN. lc := #mElViN. empty := #' '. self assert: uc withFirstCharacterDownshifted = lc. self assert: lc withFirstCharacterDownshifted = lc. ! !