-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #423 from GemTalk/candidateV1.2
v1.2.3 release
- Loading branch information
Showing
44 changed files
with
2,526 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ms/gemstone/projects/cypress/src/Cypress-Environmental-Tools/CypressAddition.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Extension { #name : 'CypressAddition' } | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressAddition >> loadClassDefinition: aSymbolDictionaryName environmentLoader: environmentLoader [ | ||
self definition | ||
loadClassDefinition: aSymbolDictionaryName | ||
environmentLoader: environmentLoader | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressAddition >> loadMethodDefinition: lookupSymbolList environmentLoader: environmentLoader [ | ||
self definition | ||
loadMethodDefinition: lookupSymbolList | ||
environmentLoader: environmentLoader | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressAddition >> postLoadDefinition: lookupSymbolList environmentId: environmentId [ | ||
self definition | ||
postLoadOver: nil | ||
lookupSymbolList: lookupSymbolList | ||
environmentId: environmentId | ||
|
||
] |
85 changes: 85 additions & 0 deletions
85
...tone/projects/cypress/src/Cypress-Environmental-Tools/CypressClassDefinition.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
Extension { #name : 'CypressClassDefinition' } | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressClassDefinition >> createOrReviseClass: aSymbolDictionaryName environmentLoader: environmentLoader [ | ||
^ self subclassType = '' | ||
ifTrue: [ | ||
self | ||
createOrReviseRegularClass: aSymbolDictionaryName | ||
environmentLoader: environmentLoader ] | ||
ifFalse: [ | ||
self subclassType = 'byteSubclass' | ||
ifTrue: [ | ||
self | ||
createOrReviseByteClass: aSymbolDictionaryName | ||
environmentLoader: environmentLoader ] | ||
ifFalse: [ | ||
self subclassType = 'indexableSubclass' | ||
ifTrue: [ | ||
self | ||
createOrReviseIndexableClass: aSymbolDictionaryName | ||
environmentLoader: environmentLoader ] | ||
ifFalse: [ self error: 'unknown subclass type: ' , self subclassType printString ] ] ] | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressClassDefinition >> createOrReviseRegularClass: aSymbolDictionaryName environmentLoader: environmentLoader [ | ||
"To be resolved: | ||
- the question of an 'environment' in which to create the class. | ||
- the question of which SymbolDictionary in which to create the class. | ||
These are perhaps the same question." | ||
|
||
| superClass lookupSymbolList | | ||
lookupSymbolList := environmentLoader lookupSymbolList. | ||
superClass := (lookupSymbolList resolveSymbol: self superclassName) value. | ||
^ (superClass | ||
subclass: self name | ||
instVarNames: (self instVarNames collect: [ :each | each asSymbol ]) | ||
classVars: (self classVarNames collect: [ :each | each asSymbol ]) | ||
classInstVars: (self classInstVarNames collect: [ :each | each asSymbol ]) | ||
poolDictionaries: #() | ||
inDictionary: | ||
((self symbolDictionaryForClassNamed: self name symbolList: lookupSymbolList) | ||
ifNil: [ (lookupSymbolList resolveSymbol: aSymbolDictionaryName) value ]) | ||
options: #()) | ||
category: category; | ||
comment: self comment | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressClassDefinition >> loadClassDefinition: aSymbolDictionaryName environmentLoader: environmentLoader [ | ||
"Create a new version of the defined class. If the class already exists, | ||
copy the behaviors and state from the old version." | ||
|
||
| newClass oldClass lookupSymbolList | | ||
lookupSymbolList := environmentLoader lookupSymbolList. | ||
self defaultSymbolDictionaryName: aSymbolDictionaryName. | ||
(lookupSymbolList resolveSymbol: self name) | ||
ifNotNil: [ :assoc | oldClass := assoc value ]. | ||
newClass := self | ||
createOrReviseClass: aSymbolDictionaryName | ||
environmentLoader: environmentLoader. | ||
(oldClass isNil or: [ newClass == oldClass ]) | ||
ifTrue: [ ^ self ]. | ||
self classNeedingMigration: newClass. | ||
self | ||
recompileWithSubclassesFrom: oldClass | ||
to: newClass | ||
symbolList: lookupSymbolList | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressClassDefinition >> symbolDictionaryForClassNamed: aString symbolList: aSymbolList [ | ||
"Answer the SymbolDictionary containing the named class. | ||
If there are multiple answers, answer the first. | ||
If there are no answers (i.e., the class does not exist), answer | ||
the result of evaluating aBlock." | ||
|
||
^ aSymbolList asArray detect: [ :each | each | ||
anySatisfy: [ :every | every isBehavior and: [ every name asString = aString asString ] ] ] | ||
ifNone: [ ] | ||
|
||
] |
28 changes: 28 additions & 0 deletions
28
.../gemstone/projects/cypress/src/Cypress-Environmental-Tools/CypressDefinition.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Extension { #name : 'CypressDefinition' } | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressDefinition >> loadClassDefinition: aSymbolDictionaryName environmentLoader: environmentLoader [ | ||
"default is to do nothing" | ||
|
||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressDefinition >> loadMethodDefinition: lookupSymbolList environmentLoader: environmentLoader [ | ||
"default is to do nothing" | ||
|
||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressDefinition >> postLoad: lookupSymbolList environmentId: environmentId [ | ||
"noop" | ||
|
||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressDefinition >> postLoadOver: aDefinition lookupSymbolList: lookupSymbolList environmentId: environmentId [ | ||
self postLoad: lookupSymbolList environmentId: environmentId | ||
|
||
] |
40 changes: 40 additions & 0 deletions
40
...one/projects/cypress/src/Cypress-Environmental-Tools/CypressMethodDefinition.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Extension { #name : 'CypressMethodDefinition' } | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressMethodDefinition >> loadMethodDefinition: lookupSymbolList environmentLoader: environmentLoader [ | ||
| cls actualCls | | ||
cls := (lookupSymbolList resolveSymbol: self className) value. | ||
actualCls := self classIsMeta | ||
ifTrue: [ cls class ] | ||
ifFalse: [ cls ]. | ||
actualCls | ||
compileMethod: self source | ||
dictionaries: environmentLoader compilationSymbolList | ||
category: self category | ||
environmentId: environmentLoader defaultEnvironmentId | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressMethodDefinition >> postLoadOver: aDefinition lookupSymbolList: lookupSymbolList environmentId: environmentId [ | ||
super | ||
postLoadOver: aDefinition | ||
lookupSymbolList: lookupSymbolList | ||
environmentId: environmentId. | ||
(self isInitializer | ||
and: [ aDefinition isNil or: [ self source ~= aDefinition source ] ]) | ||
ifTrue: [ | ||
(self theNonMetaClass: lookupSymbolList) | ||
perform: #'initialize' | ||
env: environmentId ] | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressMethodDefinition >> theNonMetaClass: lookupSymbolList [ | ||
^ self | ||
resolveGlobalNamed: self className | ||
lookupSymbolList: lookupSymbolList | ||
or: [ ] | ||
|
||
] |
26 changes: 26 additions & 0 deletions
26
...emstone/projects/cypress/src/Cypress-Environmental-Tools/CypressModification.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Extension { #name : 'CypressModification' } | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressModification >> loadClassDefinition: aSymbolDictionaryName environmentLoader: environmentLoader [ | ||
self modification | ||
loadClassDefinition: aSymbolDictionaryName | ||
environmentLoader: environmentLoader | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressModification >> loadMethodDefinition: lookupSymbolList environmentLoader: environmentLoader [ | ||
self modification | ||
loadMethodDefinition: lookupSymbolList | ||
environmentLoader: environmentLoader | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressModification >> postLoadDefinition: lookupSymbolList environmentId: environmentId [ | ||
self modification | ||
postLoadOver: self obsoletion | ||
lookupSymbolList: lookupSymbolList | ||
environmentId: environmentId | ||
|
||
] |
7 changes: 7 additions & 0 deletions
7
...orms/gemstone/projects/cypress/src/Cypress-Environmental-Tools/CypressObject.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Extension { #name : 'CypressObject' } | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressObject >> resolveGlobalNamed: aString lookupSymbolList: lookupSymbolList or: aBlock [ | ||
^ ((lookupSymbolList resolveSymbol: aString) ifNil: [ ^ aBlock value ]) value | ||
|
||
] |
25 changes: 25 additions & 0 deletions
25
...rms/gemstone/projects/cypress/src/Cypress-Environmental-Tools/CypressRemoval.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Extension { #name : 'CypressRemoval' } | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressRemoval >> loadClassDefinition: aSymbolDictionaryName environmentLoader: environmentLoader [ | ||
CypressError | ||
signal: | ||
'inappropriate to send #loadClassDefinition:environmentLoader: to a removal operation' | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressRemoval >> loadMethodDefinition: lookupSymbolList environmentLoader: environmentLoader [ | ||
CypressError | ||
signal: | ||
'inappropriate to send #loadMethodDefinition:environmentLoader: to a removal operation' | ||
|
||
] | ||
|
||
{ #category : '*cypress-environmental-tools' } | ||
CypressRemoval >> postLoadDefinition: lookupSymbolList environmentId: environmentId [ | ||
CypressError | ||
signal: | ||
'inappropriate to send #postLoadDefinition:environmentId: to a removal operation' | ||
|
||
] |
66 changes: 66 additions & 0 deletions
66
...s/gemstone/projects/cypress/src/Cypress-MesssageDigest/CypressClassStructure.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
Extension { #name : 'CypressClassStructure' } | ||
|
||
{ #category : '*Cypress-MesssageDigest' } | ||
CypressClassStructure >> addToDigest: aMessageDigestStream [ | ||
|
||
aMessageDigestStream | ||
tab; | ||
tab; | ||
nextPutAll: self class name; | ||
cr; | ||
tab; | ||
tab; | ||
tab; | ||
nextPutAll: 'extension:'; | ||
nextPutAll: self isClassExtension printString; | ||
cr; | ||
tab; | ||
tab; | ||
tab; | ||
nextPutAll: 'comment:'; | ||
nextPutAll: self comment; | ||
cr; | ||
tab; | ||
tab; | ||
tab; | ||
nextPutAll: 'properties:'; | ||
cr; | ||
tab; | ||
tab; | ||
tab; | ||
tab. | ||
self properties _writeCypressJsonOn: aMessageDigestStream indent: 4. | ||
aMessageDigestStream | ||
cr; | ||
tab; | ||
tab; | ||
tab; | ||
nextPutAll: 'class methods:'; | ||
cr. | ||
(self classMethods asSortedCollection: | ||
[:a :b | | ||
(a isMetaclass printString , a selector) | ||
< (b isMetaclass printString , b selector)]) | ||
do: [:each | each addToDigest: aMessageDigestStream]. | ||
aMessageDigestStream | ||
tab; | ||
tab; | ||
tab; | ||
nextPutAll: 'instance methods:'; | ||
cr. | ||
(self instanceMethods asSortedCollection: | ||
[:a :b | | ||
(a isMetaclass printString , a selector) | ||
< (b isMetaclass printString , b selector)]) | ||
do: [:each | each addToDigest: aMessageDigestStream] | ||
|
||
] | ||
|
||
{ #category : '*Cypress-MesssageDigest' } | ||
CypressClassStructure >> isSkeleton [ | ||
|
||
^instanceMethods isNil | ||
and: [classMethods isNil | ||
and: [comment isNil | ||
and: [isClassExtension isNil]]] | ||
] |
Oops, something went wrong.