[Pharo-project] Issue 3247 in pharo: Remodel Text Constants

pharo at googlecode.com pharo at googlecode.com
Sat Nov 13 15:41:23 CET 2010


Comment #11 on issue 3247 by stephane.ducasse: Remodel Text Constants
http://code.google.com/p/pharo/issues/detail?id=3247

Ben when a class uses a Pool you can use the key of the variable instead of  
the at: expression

For example:

text: aText
	"Answer an instance of me such that the text displayed is aText
	according to the system's default text style."

	^self new
		setText: aText
		textStyle: DefaultTextStyle copy
		offset: 0 @ 0

is better than

text: aText
	"Answer an instance of me such that the text displayed is aText
	according to the system's default text style."

	^self new
		setText: aText
		textStyle: (SharedDictionary at: #DefaultTextStyle) copy
		offset: 0 @ 0





More information about the Pharo-project mailing list