The Trunk: Tools-topa.733.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tools-topa.733.mcz

commits-2
Tobias Pape uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-topa.733.mcz

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

Name: Tools-topa.733
Author: topa
Time: 29 November 2016, 3:30:41.552525 pm
UUID: d6d53751-c59e-42e7-85b1-cc4278da5052
Ancestors: Tools-nice.732, Tools-topa.721

merge

=============== Diff against Tools-nice.732 ===============

Item was added:
+ ----- Method: Behavior>>createGetterFor: (in category '*Tools-Browser-accessors') -----
+ createGetterFor: aName
+
+ | code |
+ code := '{1}\ <generated>\\ ^ {1}\' withCRs format: {aName.}.
+ self compile: code classified: #accessing notifying: nil.!

Item was added:
+ ----- Method: Behavior>>createInstVarAccessors (in category '*Tools-Browser-accessors') -----
+ createInstVarAccessors
+ "Create getters and setters for all inst vars defined here,
+ except do NOT clobber or override any selectors already understood by me"
+
+ self instVarNames
+ collect: [:each | each asSymbol]
+ thenDo: [:instVar |
+ (self canUnderstand: instVar) ifFalse: [self createGetterFor: instVar].
+ (self canUnderstand: instVar asMutator) ifFalse: [self createSetterFor: instVar]].
+
+ !

Item was added:
+ ----- Method: Behavior>>createSetterFor: (in category '*Tools-Browser-accessors') -----
+ createSetterFor: aName
+
+ | code |
+ code := '{1}: anObject\ <generated>\\ {2}{1} := anObject.\' withCRs
+ format: {aName. self settersReturnValue ifTrue: ['^ '] ifFalse: [''].}.
+ self compile: code classified: #accessing notifying: nil.!

Item was changed:
  ----- Method: Browser>>createInstVarAccessors (in category 'class functions') -----
  createInstVarAccessors
- "Create getters and setters for all inst vars defined at the level of the current class selection,
- except do NOT clobber or override any selectors already understood by the instances of the selected class"
 
+ self selectedClassOrMetaClass
+ ifNotNil: [:aClass | aClass createInstVarAccessors].
+ !
- self selectedClassOrMetaClass ifNotNil:
- [:aClass| | cr |
- cr := String with: Character cr.
- aClass instVarNames do:
- [:aName | | newMessage setter |
- (aClass canUnderstand: aName asSymbol) ifFalse:
- [newMessage :=
- aName, cr, cr,
- ' ^ ', aName.
- aClass compile: newMessage classified: #accessing notifying: nil].
- (aClass canUnderstand: (setter := aName, ':') asSymbol) ifFalse:
- [newMessage :=
- setter, ' anObject', cr, cr,
- (aClass settersReturnValue ifTrue: [' ^'] ifFalse: [' ']),
- aName, ' := anObject'.
- aClass compile: newMessage classified: #accessing notifying: nil]]]!