The Trunk: ShoutCore-ul.23.mcz

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

The Trunk: ShoutCore-ul.23.mcz

commits-2
Levente Uzonyi uploaded a new version of ShoutCore to project The Trunk:
http://source.squeak.org/trunk/ShoutCore-ul.23.mcz

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

Name: ShoutCore-ul.23
Author: ul
Time: 12 October 2010, 3:29:41.769 am
UUID: 0fb09064-909f-5b4b-85ec-3902216aa4d4
Ancestors: ShoutCore-ul.22

- moved all implementors of #hasBindingThatBeginsWith: to this package

=============== Diff against ShoutCore-ul.22 ===============

Item was added:
+ ----- Method: Dictionary>>hasBindingThatBeginsWith: (in category '*ShoutCore') -----
+ hasBindingThatBeginsWith: aString
+ "Answer true if the receiver has a key that begins with aString, false otherwise"
+
+ self keysDo:[:each |
+ (each beginsWith: aString)
+ ifTrue:[^true]].
+ ^false!

Item was added:
+ ----- Method: SharedPool class>>hasBindingThatBeginsWith: (in category '*ShoutCore') -----
+ hasBindingThatBeginsWith: aString
+ "Answer true if the receiver has a binding that begins with aString, false otherwise"
+
+ "First look in classVar dictionary."
+ (self classPool hasBindingThatBeginsWith: aString) ifTrue:[^true].
+ "Next look in shared pools."
+ self sharedPools do:[:pool |
+ (pool hasBindingThatBeginsWith: aString) ifTrue: [^true]].
+ ^false!

Item was added:
+ ----- Method: SmalltalkImage>>hasBindingThatBeginsWith: (in category '*ShoutCore') -----
+ hasBindingThatBeginsWith: aString
+ "Answer true if the receiver has a key that begins with aString, false otherwise"
+
+ ^globals hasBindingThatBeginsWith: aString!

Item was added:
+ ----- Method: SystemDictionary>>hasBindingThatBeginsWith: (in category '*ShoutCore') -----
+ hasBindingThatBeginsWith: aString
+ "Use the cached class and non-class names for better performance."
+
+ | name searchBlock |
+ searchBlock := [ :element |
+ (element beginsWith: aString)
+ ifTrue: [ 0 ]
+ ifFalse: [
+ aString < element
+ ifTrue: [ -1 ]
+ ifFalse: [ 1 ] ] ].
+ name := self classNames
+ findBinary: searchBlock
+ ifNone: nil.
+ name ifNotNil: [ ^true ].
+ name := self nonClassNames
+ findBinary: searchBlock
+ ifNone: nil.
+ ^name notNil!

Item was added:
+ ----- Method: Workspace>>hasBindingThatBeginsWith: (in category '*ShoutCore') -----
+ hasBindingThatBeginsWith: aString
+
+ bindings ifNil: [ ^false ].
+ bindings keysDo: [ :each |
+ (each beginsWith: aString) ifTrue: [ ^true ] ].
+ ^false!