-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code that swaps two classes, exchanges their names and lets the second class adopt all instances of the other
- Loading branch information
1 parent
61d5045
commit e90382e
Showing
24 changed files
with
126 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"noMethodMetaData" : true, | ||
"separateMethodMetaAndSource" : false, | ||
"useCypressPropertiesFile" : true } |
Empty file.
4 changes: 4 additions & 0 deletions
4
packages/TraitClasses-Experiments.package/MyClass.class/instance/method1.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,4 @@ | ||
as yet unclassified | ||
method1 | ||
|
||
^ 1 |
3 changes: 3 additions & 0 deletions
3
packages/TraitClasses-Experiments.package/MyClass.class/instance/state11..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,3 @@ | ||
accessing | ||
state11: anObject | ||
state1 := anObject |
3 changes: 3 additions & 0 deletions
3
packages/TraitClasses-Experiments.package/MyClass.class/instance/state11.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,3 @@ | ||
accessing | ||
state11 | ||
^ state1 |
3 changes: 3 additions & 0 deletions
3
packages/TraitClasses-Experiments.package/MyClass.class/instance/state3..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,3 @@ | ||
accessing | ||
state3: anObject | ||
state3 := anObject |
3 changes: 3 additions & 0 deletions
3
packages/TraitClasses-Experiments.package/MyClass.class/instance/state3.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,3 @@ | ||
accessing | ||
state3 | ||
^ state3 |
9 changes: 9 additions & 0 deletions
9
packages/TraitClasses-Experiments.package/MyClass.class/methodProperties.json
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,9 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"method1" : "lt 1/19/2013 11:27:30.263", | ||
"state11" : "lt 1/19/2013 11:27:18.701999999999998", | ||
"state11:" : "lt 1/19/2013 11:27:18.709", | ||
"state3" : "lt 1/19/2013 11:42:39.181", | ||
"state3:" : "lt 1/19/2013 11:42:39.186" } } |
15 changes: 15 additions & 0 deletions
15
packages/TraitClasses-Experiments.package/MyClass.class/properties.json
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,15 @@ | ||
{ | ||
"category" : "TraitClasses-Experiments", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"state1", | ||
"state3" ], | ||
"name" : "MyClass", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
Empty file.
4 changes: 4 additions & 0 deletions
4
packages/TraitClasses-Experiments.package/MyTraitedClass.class/instance/method2.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,4 @@ | ||
as yet unclassified | ||
method2 | ||
|
||
^ 2 |
3 changes: 3 additions & 0 deletions
3
packages/TraitClasses-Experiments.package/MyTraitedClass.class/instance/state2..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,3 @@ | ||
accessing | ||
state2: anObject | ||
state2 := anObject |
3 changes: 3 additions & 0 deletions
3
packages/TraitClasses-Experiments.package/MyTraitedClass.class/instance/state2.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,3 @@ | ||
accessing | ||
state2 | ||
^ state2 |
7 changes: 7 additions & 0 deletions
7
packages/TraitClasses-Experiments.package/MyTraitedClass.class/methodProperties.json
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 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"method2" : "lt 1/19/2013 11:27:36.038", | ||
"state2" : "lt 1/19/2013 11:27:48.717", | ||
"state2:" : "lt 1/19/2013 11:27:54.455" } } |
14 changes: 14 additions & 0 deletions
14
packages/TraitClasses-Experiments.package/MyTraitedClass.class/properties.json
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,14 @@ | ||
{ | ||
"category" : "TraitClasses-Experiments", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"state2" ], | ||
"name" : "MyTraitedClass", | ||
"pools" : [ | ||
], | ||
"super" : "MyClass", | ||
"type" : "normal" } |
Empty file.
27 changes: 27 additions & 0 deletions
27
packages/TraitClasses-Experiments.package/TraitUtility.class/class/class.be..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,27 @@ | ||
as yet unclassified | ||
class: classA be: classB | ||
|
||
| firstClass firstClassName secondClass secondClassName | | ||
firstClass := classA. | ||
firstClassName := classA name asSymbol. | ||
secondClass := classB. | ||
secondClassName := classB name asSymbol. | ||
|
||
firstClass setName: secondClassName. | ||
secondClass setName: firstClassName. | ||
|
||
Smalltalk | ||
at: firstClassName put: secondClass; | ||
at: secondClassName put: firstClass. | ||
|
||
secondClass updateInstancesFrom: firstClass. | ||
|
||
"firstClass allInstances do: [:each | | ||
secondClass adoptInstance: each from: firstClass ]. | ||
secondClass allInstances do: [:each | | ||
secondClass adoptInstance: each from: firstClass ]." | ||
|
||
"firstClass allInstances do: [:each| | ||
each primitiveChangeClassTo: secondClass]. | ||
secondClass allInstances do: [:each| | ||
each primitiveChangeClassTo: firstClass]." |
5 changes: 5 additions & 0 deletions
5
packages/TraitClasses-Experiments.package/TraitUtility.class/methodProperties.json
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,5 @@ | ||
{ | ||
"class" : { | ||
"class:be:" : "lt 1/19/2013 11:38:39.184" }, | ||
"instance" : { | ||
} } |
14 changes: 14 additions & 0 deletions
14
packages/TraitClasses-Experiments.package/TraitUtility.class/properties.json
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,14 @@ | ||
{ | ||
"category" : "TraitClasses-Experiments", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"state2" ], | ||
"name" : "TraitUtility", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
1 change: 1 addition & 0 deletions
1
packages/TraitClasses-Experiments.package/monticello.meta/categories.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 @@ | ||
SystemOrganization addCategory: #'TraitClasses-Experiments'! |
Empty file.
1 change: 1 addition & 0 deletions
1
packages/TraitClasses-Experiments.package/monticello.meta/package
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 @@ | ||
(name 'TraitClasses-Experiments') |
1 change: 1 addition & 0 deletions
1
packages/TraitClasses-Experiments.package/monticello.meta/version
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 @@ | ||
(name 'TraitClasses-Experiments-lt.1' message 'experiment for issue #32, code that swaps two classes, exchanges their names and lets the second class adopt all instances of the other' id 'bdc59159-b997-478b-8b17-cb1758d8ddab' date '19 January 2013' time '11:48:13.16 am' author 'lt' ancestors () stepChildren ()) |
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,2 @@ | ||
{ | ||
} |