The Trunk: Kernel-eem.948.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-eem.948.mcz

commits-2
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.948.mcz

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

Name: Kernel-eem.948
Author: eem
Time: 25 August 2015, 4:45:37.484 pm
UUID: 45d1146b-9349-4519-9108-af1e414c58dc
Ancestors: Kernel-eem.947

Implement Ephemeron class creation, e.g.
Association ephemeronSubclass: #Ephemeron
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Collections-Weak'

=============== Diff against Kernel-eem.947 ===============

Item was added:
+ ----- Method: Class>>ephemeronSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category: (in category 'subclass creation') -----
+ ephemeronSubclass: t instanceVariableNames: f classVariableNames: d poolDictionaries: s category: cat
+ "This is the standard initialization message for creating a new class as a
+ subclass of an existing class (the receiver) in which the subclass is to
+ have ephemeron semantics, i.e. where the object will be queued for
+ finalization when the key (first) inst var is not reachable other than through
+ the other fields of ephemerons with unreachable keys."
+ ^ClassBuilder new
+ superclass: self
+ ephemeronSubclass: t
+ instanceVariableNames: f
+ classVariableNames: d
+ poolDictionaries: s
+ category: cat!

Item was added:
+ ----- Method: ClassBuilder>>superclass:ephemeronSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category: (in category 'public') -----
+ superclass: aClass
+ ephemeronSubclass: t instanceVariableNames: f
+ classVariableNames: d poolDictionaries: s category: cat
+ "This is the standard initialization message for creating a new class as a
+ subclass of an existing class (the receiver) in which the subclass is to
+ have ephemeron semantics, i.e. where the object will be queued for
+ finalization when the key (first) inst var is not reachable other than through
+ the other fields of ephemerons with unreachable keys."
+ | env |
+ aClass isPointers ifFalse:
+ [^self error: 'cannot make a pointer subclass of a class with non-pointer fields'].
+ aClass instSize + (f subStrings: ' \' withCRs) size < 2 ifTrue:
+ [^self error: 'cannot make an ephemeron class with less than two named instance varaibles'].
+ env := CurrentEnvironment signal ifNil: [aClass environment].
+ ^self
+ name: t
+ inEnvironment: env
+ subclassOf: aClass
+ type: #ephemeron
+ instanceVariableNames: f
+ classVariableNames: d
+ poolDictionaries: s
+ category: cat!