The Trunk: Kernel-nice.289.mcz

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

The Trunk: Kernel-nice.289.mcz

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

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

Name: Kernel-nice.289
Author: nice
Time: 8 November 2009, 1:03:07 am
UUID: 1a0c4764-9a36-4944-a87c-dfe5299dcc32
Ancestors: Kernel-tbn.288

Fix from http://code.google.com/p/pharo/issues/detail?id=1424
This will allow comparing
a MethodProperties analogousCodeTo: an AdditionalMethodState
et vice et versa

=============== Diff against Kernel-tbn.288 ===============

Item was added:
+ ----- Method: AdditionalMethodState>>hasAtLeastTheSamePropertiesAs: (in category 'testing') -----
+ hasAtLeastTheSamePropertiesAs: aMethodProperties
+ "Answer if the recever has at least the same properties as the argument.
+ N.B. The receiver may have additional properties and still answer true."
+ aMethodProperties keysAndValuesDo:
+ [:k :v|
+ (v isKindOf: Pragma)
+ "ifTrue: [Pragmas have already been checked]"
+ ifFalse: [
+ (self includes: k->v) ifFalse: [^false]]].
+ ^true!

Item was changed:
  ----- Method: MethodProperties>>hasAtLeastTheSamePropertiesAs: (in category 'testing') -----
  hasAtLeastTheSamePropertiesAs: aMethodProperties
  "Answer if the recever has at least the same properties as the argument.
  N.B. The receiver may have additional properties and still answer true."
  aMethodProperties keysAndValuesDo:
  [:k :v|
+ (v isKindOf: Pragma)
+ "ifTrue: [Pragmas have already been checked]"
+ ifFalse: [
+ properties ifNil: [^false].
+ ^(properties at: k ifAbsent: [^false]) = v]].
- properties ifNil: [^false].
- ^(properties at: k ifAbsent: [^false]) = v].
  ^true!

Item was changed:
  ----- Method: AdditionalMethodState>>analogousCodeTo: (in category 'testing') -----
  analogousCodeTo: aMethodProperties
  | bs |
+ (aMethodProperties isKindOf: MethodProperties) ifTrue: [^aMethodProperties analogousCodeTo: self].
  (bs := self basicSize) ~= aMethodProperties basicSize ifTrue:
  [^false].
  1 to: bs do:
  [:i|
  ((self basicAt: i) analogousCodeTo: (aMethodProperties basicAt: i)) ifFalse:
  [^false]].
  ^true!