[squeak-dev] The Trunk: EToys-nice.37.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Oct 20 19:31:03 UTC 2009


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

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

Name: EToys-nice.37
Author: nice
Time: 20 October 2009, 9:30:13 am
UUID: 4a1de39f-c516-47c3-919c-01969df2fc32
Ancestors: EToys-nice.36

Track selectors usage, use #includesSelector: #selectorsDo: and #includesKey: where due

=============== Diff against EToys-nice.36 ===============

Item was changed:
  ----- Method: ButtonProperties>>editButtonsScript: (in category 'events') -----
  editButtonsScript: evt
  	"The user has touched my Scriptor halo-handle.  Bring up a Scriptor on the script of the button."
  
  	| cardsPasteUp cardsPlayer anEditor scriptSelector |
  
  	cardsPasteUp := self pasteUpMorph.
  	(cardsPlayer := cardsPasteUp assuredPlayer) assureUniClass.
  	scriptSelector := self figureOutScriptSelector.
  	scriptSelector ifNil: [
  		scriptSelector := cardsPasteUp scriptSelectorToTriggerFor: self.
  		anEditor := cardsPlayer newTextualScriptorFor: scriptSelector.
  		evt hand attachMorph: anEditor.
  		^self
  	].
  
+ 	(cardsPlayer class includesSelector: scriptSelector) ifTrue: [
- 	(cardsPlayer class selectors includes: scriptSelector) ifTrue: [
  		anEditor := cardsPlayer scriptEditorFor: scriptSelector.
  		evt hand attachMorph: anEditor.
  		^self
  	].
  	"Method somehow got removed; I guess we start aftresh"
  	scriptSelector := nil.
  	^ self editButtonsScript!

Item was changed:
  ----- Method: Player>>newTextualScriptorFor: (in category 'scripts-kernel') -----
  newTextualScriptorFor: aSelector
  	"Sprout a scriptor for aSelector, opening up in textual mode.  Rather special-purpose, consult my lone sender"
  
  	| aMethodWithInterface aScriptEditor |
+ 	(self class includesSelector: aSelector) ifTrue: [self error: 'selector already exists'].
- 	(self class selectors includes: aSelector) ifTrue: [self error: 'selector already exists'].
  
  	aMethodWithInterface := self class permanentUserScriptFor: aSelector player: self.
  	aScriptEditor := aMethodWithInterface instantiatedScriptEditorForPlayer: self.
  	aScriptEditor install.
  	aScriptEditor showSourceInScriptor.
  	aMethodWithInterface selector numArgs == 0 ifTrue:
  		[self class allSubInstancesDo: [:anInst | anInst scriptInstantiationForSelector: aMethodWithInterface selector]].
  		"The above assures the presence of a ScriptInstantiation for the new selector in all siblings"
  
  	self updateAllViewersAndForceToShow: #scripts.
  	^ aScriptEditor!

Item was changed:
  ----- Method: ScriptableButton>>editButtonsScript (in category 'script') -----
  editButtonsScript
  	"The user has touched my Scriptor halo-handle.  Bring up a Scriptor on the script of the button."
  
  	| cardsPasteUp cardsPlayer anEditor |
  	cardsPasteUp := self pasteUpMorph.
  	(cardsPlayer := cardsPasteUp assuredPlayer) assureUniClass.
  	anEditor := scriptSelector ifNil: 
  					[scriptSelector := cardsPasteUp scriptSelectorToTriggerFor: self.
  					cardsPlayer newTextualScriptorFor: scriptSelector.
  					cardsPlayer scriptEditorFor: scriptSelector
  					]
  				ifNotNil: 
+ 					[(cardsPlayer class includesSelector: scriptSelector) 
- 					[(cardsPlayer class selectors includes: scriptSelector) 
  						ifTrue: [cardsPlayer scriptEditorFor: scriptSelector]
  						ifFalse: 
  							["Method somehow got removed; I guess we start afresh"
  
  							scriptSelector := nil.
  							^self editButtonsScript]].
  	anEditor showingMethodPane ifTrue: [anEditor toggleWhetherShowingTiles].
  	self currentHand attachMorph: anEditor!

Item was changed:
  ----- Method: KedamaMorph>>makeTurtles:examplerPlayer:color:ofPrototype:turtles:randomize: (in category 'turtles') -----
  makeTurtles: count examplerPlayer: tp color: c ofPrototype: prototype turtles: turtles randomize: randomizeFlag
  
  	| array inst |
  	array := tp turtles.
+ 	(turtlesDict includesKey: tp) ifFalse: [
- 	(turtlesDict keys includes: tp) ifFalse: [
  		self addToTurtleDisplayList: tp.
  		turtlesDict at: tp put: (array := turtles).
  	].
  
  	inst := prototype ifNil: [self makePrototypeOfExampler: tp color: c].
  
  	turtlesDictSemaphore critical: [array setTurtlesCount: count prototype: inst for: self randomize: randomizeFlag].
  	self calcTurtlesCount.
  	self changed.
  !

Item was changed:
  ----- Method: SyntaxMorph class>>testAll (in category 'as yet unclassified') -----
  testAll
  
  	| source tree total count systNav|
  "
  SyntaxMorph testAll
  "
  	systNav := self systemNavigation.
  	count := total := 0.
  	systNav allBehaviorsDo: [ :aClass | total := total + 1].
  'Testing all behaviors'
  	displayProgressAt: Sensor cursorPoint
  	from: 0 to: total
  	during: [ :bar |
  		systNav allBehaviorsDo: [ :aClass |
  			bar value: (count := count + 1).
+ 			aClass selectorsDo: [ :aSelector |
- 			aClass selectors do: [ :aSelector |
  				source := (aClass compiledMethodAt: aSelector) getSourceFromFile.
  				tree := Compiler new 
  					parse: source 
  					in: aClass 
  					notifying: nil.
  				tree asMorphicSyntaxUsing: SyntaxMorph.
  			].
  		].	].
  
  
  !




More information about the Squeak-dev mailing list