[FIX] [BUG] downShiftBugFix-wiz (sm)

Peace Jerome peace_the_dreamer at yahoo.com
Sun Jun 13 14:21:49 UTC 2004


String>>withFirstCharacterDownshifted




When I tried the second example:
 
"#Will withFirstCharacterDownshifted"

it raised an error.  Should symbol respond true to
isString?

This bugfix simply avoids the question. 

The good news is it probably does not add significant
overhead since the bug has not been found before."!


!String methodsFor: 'converting' stamp: 'wiz 6/12/2004
18:03'!
withFirstCharacterDownshifted
	"Answer an object like the receiver but with first
character downshifted 
	if necesary"
	"'MElViN' withFirstCharacterDownshifted"
	"#Will withFirstCharacterDownshifted"
	| answer |
	self isEmpty
		ifTrue: [^ self].
	"answer := self isString 
	ifTrue: ["
	"don't change receiver"
	" 
	self copy] 
	ifFalse: [self asString]. 
	this is wrong because symbol isString is true."
	answer := self copy asString.
	answer at: 1 put: (answer at: 1) asLowercase.
	^ self isString
		ifTrue: [answer]
		ifFalse: [answer as: self class]! !

gziped chageset of fix attached.

Yours in service,
Jerome Peace



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: downShiftBugFix-wiz.1.cs.gz
Type: application/x-gzip
Size: 608 bytes
Desc: downShiftBugFix-wiz.1.cs.gz
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040613/5ce3bd88/downShiftBugFix-wiz.1.cs.bin


More information about the Squeak-dev mailing list