[Pkg] The Trunk: System-pre.1110.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Oct 2 13:12:44 UTC 2019

Patrick Rein uploaded a new version of System to project The Trunk:

==================== Summary ====================

Name: System-pre.1110
Author: pre
Time: 2 October 2019, 3:12:18.602738 pm
UUID: 9b6a14ee-b7dd-664d-b120-58ec32ad76b7
Ancestors: System-mt.1109

Adds asSimpleSetter and isSimpleSetter to String.

=============== Diff against System-mt.1109 ===============

Item was changed:
  ----- Method: Preferences class>>addPragmaPreference: (in category 'add/remove') -----
  addPragmaPreference: pragma
  	"Note that there will be no accessor method generated because the pragma's method does already govern that."
  	| preference |
  	((pragma keyword beginsWith: #preference:) and: [self respondsTo: pragma keyword])
  		ifFalse: [
  			"no pragma pref to be defined. do nothing"
  			^ self].
  	self assert: pragma methodClass isMeta.
  	preference := self
  		perform: pragma keyword
  		withArguments: pragma arguments.
  		provider: pragma methodClass theNonMetaClass
  		getter: pragma method selector 
+ 		setter: pragma method selector asSimpleSetter.
- 		setter: pragma method selector asMutator.
  	self atomicUpdatePreferences: [ :copyOfDictionaryOfPreferences |
  			at: preference id
  			put: preference].
  	^ preference!

Item was added:
+ ----- Method: String>>asSimpleSetter (in category '*System-Support') -----
+ asSimpleSetter
+ 	"Return a setter message from a getter message. For example, #name asMutator returns #name:"
+ 	^ self last = $:
+ 		ifTrue: [ self asSymbol ]
+ 		ifFalse: [ (self copyWith: $:) asSymbol ]!

Item was added:
+ ----- Method: String>>isSimpleSetter (in category '*System-Support') -----
+ isSimpleSetter
+ 	^ self isKeyword and: [self numArgs = 1]!

More information about the Packages mailing list