The Trunk: ST80-ar.112.mcz

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

The Trunk: ST80-ar.112.mcz

commits-2
Andreas Raab uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-ar.112.mcz

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

Name: ST80-ar.112
Author: ar
Time: 5 March 2010, 9:03:40.858 pm
UUID: 48cfbc1c-b804-1540-a584-90af16c1072b
Ancestors: ST80-dtl.111

Avoid dictionary protocol in Smalltalk.

=============== Diff against ST80-dtl.111 ===============

Item was changed:
  ----- Method: ParagraphEditor>>explainClass: (in category 'explain') -----
  explainClass: symbol
  "Is symbol a class variable or a pool variable?"
  | class reply classes |
  (model respondsTo: #selectedClassOrMetaClass)
  ifFalse: [^ nil].
  (class := model selectedClassOrMetaClass) ifNil: [^ nil].
  "no class is selected"
  (class isKindOf: Metaclass)
  ifTrue: [class := class soleInstance].
  classes := (Array with: class)
  , class allSuperclasses.
  "class variables"
  reply := classes detect: [:each | (each classVarNames detect: [:name | symbol = name]
  ifNone: [])
  ~~ nil]
  ifNone: [].
  reply == nil ifFalse: [^ '"is a class variable, defined in class ' , reply printString , '"\' withCRs , 'SystemNavigation new browseAllCallsOn: (' , reply printString , ' classPool associationAt: #' , symbol , ').'].
  "pool variables"
  classes do: [:each | (each sharedPools
  detect: [:pool | (pool includesKey: symbol)
  and:
  [reply := pool.
  true]]
  ifNone: [])
  ~~ nil].
  reply
  ifNil: [(Undeclared includesKey: symbol)
  ifTrue: [^ '"is an undeclared variable.' , '"\' withCRs , 'SystemNavigation new browseAllCallsOn: (Undeclared associationAt: #' , symbol , ').']]
  ifNotNil:
  [classes := WriteStream on: Array new.
  self systemNavigation
  allBehaviorsDo: [:each | (each sharedPools
  detect:
  [:pool |
  pool == reply]
  ifNone: [])
  ~~ nil ifTrue: [classes nextPut: each]].
  "Perhaps not print whole list of classes if too long. (unlikely)"
+ ^ '"is a pool variable from the pool ' , (Smalltalk globals keyAtIdentityValue: reply) asString , ', which is used by the following classes ' , classes contents printString , '"\' withCRs , 'SystemNavigation new browseAllCallsOn: (' , (Smalltalk globals keyAtIdentityValue: reply) asString , ' bindingOf: #' , symbol , ').'].
- ^ '"is a pool variable from the pool ' , (Smalltalk keyAtIdentityValue: reply) asString , ', which is used by the following classes ' , classes contents printString , '"\' withCRs , 'SystemNavigation new browseAllCallsOn: (' , (Smalltalk keyAtIdentityValue: reply) asString , ' bindingOf: #' , symbol , ').'].
  ^ nil!

Item was changed:
  ----- Method: ParagraphEditor>>referencesToIt (in category 'menu messages') -----
  referencesToIt
  "Open a references browser on the selected symbol"
 
  | aSymbol |
  self selectLine.
  ((aSymbol := self selectedSymbol) == nil or:
+ [(Smalltalk globals includesKey: aSymbol) not])
- [(Smalltalk includesKey: aSymbol) not])
  ifTrue: [^ view flash].
 
+ self terminateAndInitializeAround: [self systemNavigation browseAllCallsOn: (Smalltalk globals associationAt: self selectedSymbol)]!
- self terminateAndInitializeAround: [self systemNavigation browseAllCallsOn: (Smalltalk associationAt: self selectedSymbol)]!

Item was changed:
  ----- Method: MVCProject>>pauseSoundPlayers (in category 'enter') -----
  pauseSoundPlayers
  "Pause sound players, subject to preference settings"
 
+ Smalltalk at: #ScorePlayer ifPresent:[:playerClass|
+ playerClass allSubInstancesDo: [:player | player pause]]!
- Smalltalk at: #ScorePlayer
- ifPresentAndInMemory: [:playerClass | playerClass
- allSubInstancesDo: [:player | player pause]]!