The Trunk: EToys-nice.38.mcz

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

The Trunk: EToys-nice.38.mcz

commits-2
Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.38.mcz

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

Name: EToys-nice.38
Author: nice
Time: 21 October 2009, 12:22:03 pm
UUID: 28feef8f-f608-4397-8e9c-e7efe0dd307b
Ancestors: EToys-nice.37

Use #keys rather than #fasterKeys
Note that pattern (x keys asArray sort) could as well be written (x keys sort) now that keys returns an Array...
This #asArray is here solely for cross-dialect/fork compatibility.

=============== Diff against EToys-nice.37 ===============

Item was changed:
  ----- Method: PasteUpMorph>>userCustomEventNames (in category '*eToys-customevents-scripting') -----
  userCustomEventNames
  | reg |
  reg := self valueOfProperty: #userCustomEventsRegistry ifAbsent: [ ^#() ].
+ ^reg keys asArray sort!
- ^reg fasterKeys sort!

Item was changed:
  ----- Method: KedamaTurtleVectorPlayer>>compileAllAccessors (in category 'player protocol') -----
  compileAllAccessors
 
+ info keys do: [:k |
- info fasterKeys do: [:k |
  (#(who x y heading color visible) includes: k) ifFalse: [
  self compileVectorInstVarAccessorsFor: k.
  ].
  ].
  !

Item was changed:
  ----- Method: KedamaSequenceExecutionStub>>compileAllAccessors (in category 'method management') -----
  compileAllAccessors
 
+ turtles info keys do: [:k |
- turtles info fasterKeys do: [:k |
  (#(who x y heading color visible normal) includes: k) ifFalse: [
  self compileScalarInstVarAccessorsFor: k.
  ].
  ].
  !

Item was changed:
  ----- Method: EToyVocabulary>>includesSelector:forInstance:ofClass:limitClass: (in category 'initialization') -----
  includesSelector: aSelector forInstance: anInstance ofClass: aTargetClass limitClass: mostGenericClass
  "Answer whether the vocabulary includes the given selector for the given class (and instance, if provided), only considering method implementations in mostGenericClass and lower"
 
  | classToUse aClass |
  (aTargetClass isUniClass and:
  [(aTargetClass namedTileScriptSelectors includes: aSelector) or:
+ [aTargetClass slotInfo keys anySatisfy:
- [aTargetClass slotInfo fasterKeys anySatisfy:
  [:anInstVarName | (Utilities getterSelectorFor: anInstVarName) = aSelector or: [(Utilities setterSelectorFor: anInstVarName) = aSelector]]]])
  ifTrue: [^ true].
 
  (methodInterfaces includesKey: aSelector) ifFalse: [^ false].
  classToUse := self classToUseFromInstance: anInstance ofClass: aTargetClass.
  ^ (aClass := classToUse whichClassIncludesSelector: aSelector)
  ifNil:
  [false]
  ifNotNil:
  [aClass includesBehavior: mostGenericClass]
  !

Item was changed:
  ----- Method: StandardScriptingSystem>>globalCustomEventNames (in category '*eToys-customevents-custom events') -----
  globalCustomEventNames
+ ^self customEventsRegistry keys asArray sort!
- ^self customEventsRegistry fasterKeys sort!

Item was changed:
  ----- Method: EToyVocabulary>>allMethodsInCategory:forInstance:ofClass: (in category 'method list') -----
  allMethodsInCategory: aCategoryName forInstance: anObject ofClass: aClass
  "Answer a list of all methods in the etoy interface which are in the given category, on behalf of anObject, or if it is nil, aClass"
 
  | aCategory unfiltered suitableSelectors isAll |
 
  aCategoryName ifNil: [^ OrderedCollection new].
  aClass isUniClass ifTrue:
  [aCategoryName = ScriptingSystem nameForScriptsCategory ifTrue:
  [^ aClass namedTileScriptSelectors].
  aCategoryName = ScriptingSystem nameForInstanceVariablesCategory ifTrue:
+ [^ aClass slotInfo keys asArray sort collect:
- [^ aClass slotInfo fasterKeys sort collect:
  [:anInstVarName | Utilities getterSelectorFor: anInstVarName]]].
  unfiltered := (isAll := aCategoryName = self allCategoryName)
  ifTrue:
  [methodInterfaces collect: [:anInterface | anInterface selector]]
  ifFalse:
  [aCategory := categories detect: [:cat | cat categoryName = aCategoryName]
  ifNone: [^ OrderedCollection new].
  aCategory elementsInOrder collect: [:anElement | anElement selector]].
 
  (anObject isKindOf: Player) ifTrue:
  [suitableSelectors := anObject costume selectorsForViewer.
  unfiltered := unfiltered  select:
  [:aSelector | suitableSelectors includes: aSelector]].
  (isAll and: [aClass isUniClass]) ifTrue:
  [unfiltered addAll: aClass namedTileScriptSelectors.
+ unfiltered addAll: (aClass slotInfo keys sort collect:
- unfiltered addAll: (aClass slotInfo fasterKeys sort collect:
  [:anInstVarName | Utilities getterSelectorFor: anInstVarName])].
 
  ^ (unfiltered copyWithoutAll: #(dummy unused)) asSortedArray!