The Trunk: Kernel-fbs.820.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-fbs.820.mcz

commits-2
Frank Shearar uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-fbs.820.mcz

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

Name: Kernel-fbs.820
Author: fbs
Time: 20 November 2013, 11:04:52.228 pm
UUID: 7207e866-665d-bc4c-ad55-b1aba40f7f77
Ancestors: Kernel-cmm.819

Kernel has a number of SharedPools, so SharedPool belongs (for better or worse) in Kernel, not System.

=============== Diff against Kernel-cmm.819 ===============

Item was changed:
  SystemOrganization addCategory: #'Kernel-Chronology'!
  SystemOrganization addCategory: #'Kernel-Classes'!
  SystemOrganization addCategory: #'Kernel-Exceptions'!
  SystemOrganization addCategory: #'Kernel-Exceptions-Kernel'!
  SystemOrganization addCategory: #'Kernel-Methods'!
  SystemOrganization addCategory: #'Kernel-Models'!
  SystemOrganization addCategory: #'Kernel-Numbers'!
  SystemOrganization addCategory: #'Kernel-Numbers-Exceptions'!
  SystemOrganization addCategory: #'Kernel-Objects'!
  SystemOrganization addCategory: #'Kernel-Processes'!
  SystemOrganization addCategory: #'Kernel-Processes-Variables'!
+ SystemOrganization addCategory: #'Kernel-Pools'!

Item was added:
+ Object subclass: #SharedPool
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Kernel-Pools'!
+
+ !SharedPool commentStamp: '<historical>' prior: 0!
+ A shared pool represents a set of bindings which are accessible to all classes which import the pool in its 'pool dictionaries'. SharedPool is NOT a dictionary but rather a name space. Bindings are represented by 'class variables' - as long as we have no better way to represent them at least.!

Item was added:
+ ----- Method: SharedPool class>>bindingOf: (in category 'name lookup') -----
+ bindingOf: varName
+ "Answer the binding of some variable resolved in the scope of the receiver"
+ | aSymbol binding |
+ aSymbol := varName asSymbol.
+
+ "First look in classVar dictionary."
+ binding := self classPool bindingOf: aSymbol.
+ binding ifNotNil:[^binding].
+
+ "Next look in shared pools."
+ self sharedPools do:[:pool |
+ | poolBinding |
+ poolBinding := pool bindingOf: aSymbol.
+ poolBinding ifNotNil:[^poolBinding].
+ ].
+
+ "subclassing and environment are not preserved"
+ ^nil!

Item was added:
+ ----- Method: SharedPool class>>bindingsDo: (in category 'name lookup') -----
+ bindingsDo: aBlock
+ ^self classPool bindingsDo: aBlock!

Item was added:
+ ----- Method: SharedPool class>>classBindingOf: (in category 'name lookup') -----
+ classBindingOf: varName
+ "For initialization messages grant the regular scope"
+ ^super bindingOf: varName!

Item was added:
+ ----- Method: SharedPool class>>includesKey: (in category 'name lookup') -----
+ includesKey: aName
+ "does this pool include aName"
+ ^(self bindingOf: aName) notNil!

Item was added:
+ ----- Method: SharedPool class>>keysDo: (in category 'enumerating') -----
+ keysDo: aBlock
+ "A hopefully temporary fix for an issue arising from miss-spelled variable names in code being compiled. The correction code (see Class>possibleVariablesFor:continuedFrom: assumes that sharedPools are Dictionaries. The proper fix would involve making sure all pools are actually subclasses of SharedPool, which they are not currently."
+ self bindingsDo:[:b|
+ aBlock value: b key]!