Bläddra i källkod

- Organizer class
- Use organizer for packages and classes

Nicolas Petton 11 år sedan
förälder
incheckning
0af9574208
7 ändrade filer med 261 tillägg och 77 borttagningar
  1. 20 14
      js/Kernel-Classes.deploy.js
  2. 29 18
      js/Kernel-Classes.js
  3. 47 6
      js/Kernel-Objects.deploy.js
  4. 68 12
      js/Kernel-Objects.js
  5. 62 11
      js/boot.js
  6. 9 9
      st/Kernel-Classes.st
  7. 26 7
      st/Kernel-Objects.st

+ 20 - 14
js/Kernel-Classes.deploy.js

@@ -339,23 +339,28 @@ return $1;
 }),
 smalltalk.Behavior);
 
+smalltalk.addMethod(
+"_organization",
+smalltalk.method({
+selector: "organization",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_basicAt_",["organization"]);
+return $1;
+}
+}),
+smalltalk.Behavior);
+
 smalltalk.addMethod(
 "_protocols",
 smalltalk.method({
 selector: "protocols",
 fn: function (){
 var self=this;
-var $1,$2;
-var protocols;
-protocols=smalltalk.send((smalltalk.Array || Array),"_new",[]);
-smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_do_",[(function(each){
-$1=smalltalk.send(protocols,"_includes_",[smalltalk.send(each,"_category",[])]);
-if(! smalltalk.assert($1)){
-return smalltalk.send(protocols,"_add_",[smalltalk.send(each,"_category",[])]);
-};
-})]);
-$2=smalltalk.send(protocols,"_sort",[]);
-return $2;
+var $1;
+$1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_organization",[]),"_elements",[]),"_sorted",[]);
+return $1;
 }
 }),
 smalltalk.Behavior);
@@ -399,9 +404,10 @@ selector: "removeCompiledMethod:",
 fn: function (aMethod){
 var self=this;
 var $1,$2;
-delete self.fn.prototype[aMethod.selector._asSelector()];
-	delete self.fn.prototype.methods[aMethod.selector];
-	smalltalk.init(self);;
+
+    	smalltalk.removeMethod(aMethod)
+		smalltalk.init(self);
+    ;
 ;
 $1=smalltalk.send((smalltalk.MethodRemoved || MethodRemoved),"_new",[]);
 smalltalk.send($1,"_theClass_",[self]);

+ 29 - 18
js/Kernel-Classes.js

@@ -455,6 +455,24 @@ referencedClasses: []
 }),
 smalltalk.Behavior);
 
+smalltalk.addMethod(
+"_organization",
+smalltalk.method({
+selector: "organization",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_basicAt_",["organization"]);
+return $1;
+},
+args: [],
+source: "organization\x0a\x09^ self basicAt: 'organization'",
+messageSends: ["basicAt:"],
+referencedClasses: []
+}),
+smalltalk.Behavior);
+
 smalltalk.addMethod(
 "_protocols",
 smalltalk.method({
@@ -462,22 +480,14 @@ selector: "protocols",
 category: 'accessing',
 fn: function (){
 var self=this;
-var $1,$2;
-var protocols;
-protocols=smalltalk.send((smalltalk.Array || Array),"_new",[]);
-smalltalk.send(smalltalk.send(self,"_methodDictionary",[]),"_do_",[(function(each){
-$1=smalltalk.send(protocols,"_includes_",[smalltalk.send(each,"_category",[])]);
-if(! smalltalk.assert($1)){
-return smalltalk.send(protocols,"_add_",[smalltalk.send(each,"_category",[])]);
-};
-})]);
-$2=smalltalk.send(protocols,"_sort",[]);
-return $2;
+var $1;
+$1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_organization",[]),"_elements",[]),"_sorted",[]);
+return $1;
 },
 args: [],
-source: "protocols\x0a    | protocols |\x0a    protocols := Array new.\x0a    self methodDictionary do: [:each |\x0a\x09    (protocols includes: each category) ifFalse: [\x0a\x09\x09protocols add: each category]].\x0a    ^protocols sort",
-messageSends: ["new", "do:", "ifFalse:", "add:", "category", "includes:", "methodDictionary", "sort"],
-referencedClasses: ["Array"]
+source: "protocols\x0a   ^ self organization elements sorted",
+messageSends: ["sorted", "elements", "organization"],
+referencedClasses: []
 }),
 smalltalk.Behavior);
 
@@ -531,9 +541,10 @@ category: 'compiling',
 fn: function (aMethod){
 var self=this;
 var $1,$2;
-delete self.fn.prototype[aMethod.selector._asSelector()];
-	delete self.fn.prototype.methods[aMethod.selector];
-	smalltalk.init(self);;
+
+    	smalltalk.removeMethod(aMethod)
+		smalltalk.init(self);
+    ;
 ;
 $1=smalltalk.send((smalltalk.MethodRemoved || MethodRemoved),"_new",[]);
 smalltalk.send($1,"_theClass_",[self]);
@@ -542,7 +553,7 @@ $2=smalltalk.send($1,"_yourself",[]);
 smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$2]);
 return self},
 args: ["aMethod"],
-source: "removeCompiledMethod: aMethod\x0a\x09<delete self.fn.prototype[aMethod.selector._asSelector()];\x0a\x09delete self.fn.prototype.methods[aMethod.selector];\x0a\x09smalltalk.init(self);>.\x0a    \x0a    SystemAnnouncer current\x0a   \x09\x09announce: (MethodRemoved new\x0a        \x09theClass: self;\x0a            method: aMethod;\x0a            yourself)",
+source: "removeCompiledMethod: aMethod\x0a\x09<\x0a    \x09smalltalk.removeMethod(aMethod)\x0a\x09\x09smalltalk.init(self);\x0a    >.\x0a    \x0a    SystemAnnouncer current\x0a   \x09\x09announce: (MethodRemoved new\x0a        \x09theClass: self;\x0a            method: aMethod;\x0a            yourself)",
 messageSends: ["announce:", "theClass:", "new", "method:", "yourself", "current"],
 referencedClasses: ["MethodRemoved", "SystemAnnouncer"]
 }),

+ 47 - 6
js/Kernel-Objects.deploy.js

@@ -2171,16 +2171,32 @@ fn: function () {
 smalltalk.Number.klass);
 
 
+smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Objects');
+smalltalk.addMethod(
+"_elements",
+smalltalk.method({
+selector: "elements",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_basicAt_",["elements"]),"_copy",[]);
+return $1;
+}
+}),
+smalltalk.Organizer);
+
+
+
 smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
 smalltalk.addMethod(
 "_classes",
 smalltalk.method({
 selector: "classes",
-fn: function () {
-    var self = this;
-    var $1;
-    $1 = smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_classes", []), "_select_", [function (c) {return smalltalk.send(smalltalk.send(c, "_package", []), "__eq_eq", [self]);}]);
-    return $1;
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_organization",[]),"_elements",[]);
+return $1;
 }
 }),
 smalltalk.Package);
@@ -2319,6 +2335,19 @@ fn: function (aString) {
 }),
 smalltalk.Package);
 
+smalltalk.addMethod(
+"_organization",
+smalltalk.method({
+selector: "organization",
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_basicAt_",["organization"]);
+return $1;
+}
+}),
+smalltalk.Package);
+
 smalltalk.addMethod(
 "_printString",
 smalltalk.method({
@@ -2869,6 +2898,18 @@ fn: function (packageName, aDict) {
 }),
 smalltalk.Smalltalk);
 
+smalltalk.addMethod(
+"_deleteClass_",
+smalltalk.method({
+selector: "deleteClass:",
+fn: function (aClass){
+var self=this;
+self.removeClass(aClass);
+;
+return self}
+}),
+smalltalk.Smalltalk);
+
 smalltalk.addMethod(
 "_deletePackage_",
 smalltalk.method({
@@ -2999,7 +3040,7 @@ return smalltalk.send(aClass,"_removeCompiledMethod_",[each]);
 smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_methodDictionary",[]),"_values",[]),"_do_",[(function(each){
 return smalltalk.send(smalltalk.send(aClass,"_class",[]),"_removeCompiledMethod_",[each]);
 })]);
-smalltalk.send(self,"_basicDelete_",[smalltalk.send(aClass,"_name",[])]);
+smalltalk.send(self,"_deleteClass_",[aClass]);
 $2=smalltalk.send((smalltalk.ClassRemoved || ClassRemoved),"_new",[]);
 smalltalk.send($2,"_theClass_",[aClass]);
 $3=smalltalk.send($2,"_yourself",[]);

+ 68 - 12
js/Kernel-Objects.js

@@ -3001,6 +3001,27 @@ referencedClasses: []
 smalltalk.Number.klass);
 
 
+smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Objects');
+smalltalk.addMethod(
+"_elements",
+smalltalk.method({
+selector: "elements",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_basicAt_",["elements"]),"_copy",[]);
+return $1;
+},
+args: [],
+source: "elements\x0a\x09^ (self basicAt: 'elements') copy",
+messageSends: ["copy", "basicAt:"],
+referencedClasses: []
+}),
+smalltalk.Organizer);
+
+
+
 smalltalk.addClass('Package', smalltalk.Object, ['commitPathJs', 'commitPathSt'], 'Kernel-Objects');
 smalltalk.Package.comment="A Package is similar to a \x22class category\x22 typically found in other Smalltalks like Pharo or Squeak. Amber does not have class categories anymore, it had in the beginning but now each class in the system knows which package it belongs to.\x0a\x0aA Package has a name, an Array of \x22requires\x22, a comment and a Dictionary with other optional key value attributes. A Package can also be queried for its classes, but it will then resort to a reverse scan of all classes to find them.\x0aPackages are manipulated through \x22Smalltalk current\x22, like for example finding one based on a name:\x0a\x0a\x09Smalltalk current packageAt: 'Kernel'\x0a\x0a...but you can also use:\x0a\x0a\x09Package named: 'Kernel'\x0a\x0aA Package differs slightly from a Monticello package which can span multiple class categories using a naming convention based on hyphenation. But just as in Monticello a Package supports \x22class extensions\x22 so a Package\x0acan define behaviors in foreign classes using a naming convention for method categories where the category starts with an asterisk and then the name of the owning package follows. This can easily be seen in for example class\x0aString where the method category \x22*IDE\x22 defines #inspectOn: which thus is a method belonging to the IDE package.\x0a\x0aYou can fetch a package from the server:\x0a\x0a\x09Package fetch: 'Additional-Examples'"
 smalltalk.addMethod(
@@ -3008,16 +3029,16 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "classes",
 category: 'classes',
-fn: function () {
-    var self = this;
-    var $1;
-    $1 = smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []), "_classes", []), "_select_", [function (c) {return smalltalk.send(smalltalk.send(c, "_package", []), "__eq_eq", [self]);}]);
-    return $1;
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(smalltalk.send(self,"_organization",[]),"_elements",[]);
+return $1;
 },
 args: [],
-source: "classes\x0a\x09\x22We need to do a reverse scan.\x22\x0a\x09^Smalltalk current classes select: [:c | c package == self]",
-messageSends: ["select:", "==", "package", "classes", "current"],
-referencedClasses: ["Smalltalk"]
+source: "classes\x0a\x09^ self organization elements",
+messageSends: ["elements", "organization"],
+referencedClasses: []
 }),
 smalltalk.Package);
 
@@ -3205,6 +3226,24 @@ referencedClasses: []
 }),
 smalltalk.Package);
 
+smalltalk.addMethod(
+"_organization",
+smalltalk.method({
+selector: "organization",
+category: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=smalltalk.send(self,"_basicAt_",["organization"]);
+return $1;
+},
+args: [],
+source: "organization\x0a\x09^ self basicAt: 'organization'",
+messageSends: ["basicAt:"],
+referencedClasses: []
+}),
+smalltalk.Package);
+
 smalltalk.addMethod(
 "_printString",
 smalltalk.method({
@@ -3908,7 +3947,7 @@ smalltalk.addMethod(
 "_classes",
 smalltalk.method({
 selector: "classes",
-category: 'accessing',
+category: 'classes',
 fn: function () {
     var self = this;
     return self.classes();
@@ -3958,6 +3997,23 @@ referencedClasses: []
 }),
 smalltalk.Smalltalk);
 
+smalltalk.addMethod(
+"_deleteClass_",
+smalltalk.method({
+selector: "deleteClass:",
+category: 'private',
+fn: function (aClass){
+var self=this;
+self.removeClass(aClass);
+;
+return self},
+args: ["aClass"],
+source: "deleteClass: aClass\x0a\x09\x22Deletes a class by deleting its binding only. Use #removeClass instead\x22\x0a    \x0a\x09<self.removeClass(aClass)>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Smalltalk);
+
 smalltalk.addMethod(
 "_deletePackage_",
 smalltalk.method({
@@ -4129,15 +4185,15 @@ return smalltalk.send(aClass,"_removeCompiledMethod_",[each]);
 smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass,"_class",[]),"_methodDictionary",[]),"_values",[]),"_do_",[(function(each){
 return smalltalk.send(smalltalk.send(aClass,"_class",[]),"_removeCompiledMethod_",[each]);
 })]);
-smalltalk.send(self,"_basicDelete_",[smalltalk.send(aClass,"_name",[])]);
+smalltalk.send(self,"_deleteClass_",[aClass]);
 $2=smalltalk.send((smalltalk.ClassRemoved || ClassRemoved),"_new",[]);
 smalltalk.send($2,"_theClass_",[aClass]);
 $3=smalltalk.send($2,"_yourself",[]);
 smalltalk.send(smalltalk.send((smalltalk.SystemAnnouncer || SystemAnnouncer),"_current",[]),"_announce_",[$3]);
 return self},
 args: ["aClass"],
-source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!'].\x0a    \x0a\x09aClass methodDictionary values do: [:each |\x0a\x09\x09aClass removeCompiledMethod: each].\x0a        \x0a\x09aClass class methodDictionary values do: [:each |\x0a\x09\x09aClass class removeCompiledMethod: each].\x0a        \x0a\x09self basicDelete: aClass name.\x0a    \x0a    SystemAnnouncer current\x0a    \x09announce: (ClassRemoved new\x0a        \x09theClass: aClass;\x0a            yourself)",
-messageSends: ["ifTrue:", "error:", ",", "asString", "isMetaclass", "do:", "removeCompiledMethod:", "values", "methodDictionary", "class", "basicDelete:", "name", "announce:", "theClass:", "new", "yourself", "current"],
+source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!'].\x0a    \x0a\x09aClass methodDictionary values do: [:each |\x0a\x09\x09aClass removeCompiledMethod: each].\x0a        \x0a\x09aClass class methodDictionary values do: [:each |\x0a\x09\x09aClass class removeCompiledMethod: each].\x0a        \x0a\x09self deleteClass: aClass.\x0a    \x0a    SystemAnnouncer current\x0a    \x09announce: (ClassRemoved new\x0a        \x09theClass: aClass;\x0a            yourself)",
+messageSends: ["ifTrue:", "error:", ",", "asString", "isMetaclass", "do:", "removeCompiledMethod:", "values", "methodDictionary", "class", "deleteClass:", "announce:", "theClass:", "new", "yourself", "current"],
 referencedClasses: ["ClassRemoved", "SystemAnnouncer"]
 }),
 smalltalk.Smalltalk);

+ 62 - 11
js/boot.js

@@ -33,7 +33,7 @@
    |
    ==================================================================== */
 
-/* Make that console is defined */
+/* Make sure that console is defined */
 
 if (typeof console === "undefined") {
 	this.console = {
@@ -47,19 +47,39 @@ if (typeof console === "undefined") {
 
 /* Smalltalk constructors definition */
 
-function SmalltalkObject(){}
-function SmalltalkBehavior(){}
-function SmalltalkClass(){}
-function SmalltalkPackage(){}
+function SmalltalkObject(){};
+function SmalltalkBehavior(){};
+function SmalltalkClass(){};
+function SmalltalkPackage(){};
 function SmalltalkMetaclass(){
 	this.meta = true;
-}
-function SmalltalkMethod(){}
-function SmalltalkNil(){}
+};
+function SmalltalkMethod(){};
+function SmalltalkNil(){};
 
 function SmalltalkSymbol(string){
 	this.value = string;
-}
+};
+
+function SmalltalkOrganizer() {
+    this.elements = [];
+};
+
+SmalltalkOrganizer.prototype.addElement = function(el) {
+    if(this.elements.indexOf(el) == -1) {
+        this.elements.push(el);
+    }
+};
+
+SmalltalkOrganizer.prototype.removeElement = function(el) {
+    for(var i=0; i<this.elements.length; i++) {
+        if(this.elements[i] == el) {
+            this.elements.splice(i, 1);
+            break;
+        }
+    }
+};
+
 
 function Smalltalk(){
 
@@ -108,6 +128,7 @@ function Smalltalk(){
 	function pkg(spec) {
 		var that = new SmalltalkPackage();
 		that.pkgName = spec.pkgName;
+        that.organization = new SmalltalkOrganizer();
 		that.properties = spec.properties || {};
 		return that;
 	};
@@ -123,6 +144,7 @@ function Smalltalk(){
 		var that = setupClass(meta.instanceClass, spec);
 		that.className = spec.className;
 		meta.className = spec.className + ' class';
+        that.organization = new SmalltalkOrganizer();
 		if(spec.superclass) {
 			that.superclass = spec.superclass;
 			meta.superclass = spec.superclass.klass;
@@ -131,7 +153,8 @@ function Smalltalk(){
 	}
 	
 	function metaclass() {
-		var meta = setupClass(new SmalltalkMetaclass(), {});
+		var meta = setupClass(new SmalltalkMetaclass(), {})
+        meta.organization = new SmalltalkOrganizer();
 		meta.instanceClass = new meta.fn;
 		return meta;
 	}
@@ -320,9 +343,16 @@ function Smalltalk(){
 				iVarNames: iVarNames
 			});
 		}
+
+        pkg.organization.addElement(st[className]);
 	};
 
-	/* Add a method to a class */
+    st.removeClass = function(klass) {
+        klass.pkg.organization.removeElement(klass);
+        delete st[klass.className];
+    };
+
+	/* Add/remove a method to/from a class */
 
 	st.addMethod = function(jsSelector, method, klass) {
 		Object.defineProperty(klass.fn.prototype, jsSelector, {
@@ -331,8 +361,28 @@ function Smalltalk(){
 		klass.fn.prototype.methods[method.selector] = method;
 		method.methodClass = klass;
 		method.jsSelector = jsSelector;
+
+        klass.organization.addElement(method.category);
 	};
 
+    st.removeMethod = function(method) {
+        var protocol = method.category;
+        var shouldDeleteProtocol;
+        var klass = method.methodClass;
+
+        delete klass.fn.prototype[method.selector._asSelector()];
+	    delete klass.fn.prototype.methods[method.selector];
+
+        for(var i=0; i<klass.fn.prototype.methods; i++) {
+            if(klass.fn.prototype.methods[i].category == protocol) {
+                shouldDeleteProtocol = true;
+            };
+        };
+        if(shouldDeleteProtocol) {
+            klass.organization.removeElement(protocol)
+        };
+    };
+
 	/* Handles unhandled errors during message sends */
 
 	st.send = function(receiver, selector, args, klass) {
@@ -570,6 +620,7 @@ smalltalk.wrapClassName("Behavior", "Kernel", SmalltalkBehavior, smalltalk.Objec
 smalltalk.wrapClassName("Class", "Kernel", SmalltalkClass, smalltalk.Behavior);
 smalltalk.wrapClassName("Metaclass", "Kernel", SmalltalkMetaclass, smalltalk.Behavior);
 smalltalk.wrapClassName("CompiledMethod", "Kernel", SmalltalkMethod, smalltalk.Object);
+smalltalk.wrapClassName("Organizer", "Kernel-Objects", SmalltalkOrganizer, smalltalk.Object);
 
 smalltalk.Object.klass.superclass = smalltalk.Class;
 

+ 9 - 9
st/Kernel-Classes.st

@@ -106,13 +106,12 @@ name
 	<return self.className || nil>
 !
 
+organization
+	^ self basicAt: 'organization'
+!
+
 protocols
-    | protocols |
-    protocols := Array new.
-    self methodDictionary do: [:each |
-	    (protocols includes: each category) ifFalse: [
-		protocols add: each category]].
-    ^protocols sort
+   ^ self organization elements sorted
 !
 
 protocolsDo: aBlock
@@ -180,9 +179,10 @@ compile: aString category: anotherString
 !
 
 removeCompiledMethod: aMethod
-	<delete self.fn.prototype[aMethod.selector._asSelector()];
-	delete self.fn.prototype.methods[aMethod.selector];
-	smalltalk.init(self);>.
+	<
+    	smalltalk.removeMethod(aMethod)
+		smalltalk.init(self);
+    >.
     
     SystemAnnouncer current
    		announce: (MethodRemoved new

+ 26 - 7
st/Kernel-Objects.st

@@ -990,6 +990,16 @@ pi
 	<return Math.PI>
 ! !
 
+Object subclass: #Organizer
+	instanceVariableNames: ''
+	package: 'Kernel-Objects'!
+
+!Organizer methodsFor: 'accessing'!
+
+elements
+	^ (self basicAt: 'elements') copy
+! !
+
 Object subclass: #Package
 	instanceVariableNames: 'commitPathJs commitPathSt'
 	package: 'Kernel-Objects'!
@@ -1047,6 +1057,10 @@ name: aString
 	<self.pkgName = aString>
 !
 
+organization
+	^ self basicAt: 'organization'
+!
+
 properties
 	^Smalltalk current readJSObject: (self basicAt: 'properties')
 !
@@ -1065,8 +1079,7 @@ properties: aDict
 !Package methodsFor: 'classes'!
 
 classes
-	"We need to do a reverse scan."
-	^Smalltalk current classes select: [:c | c package == self]
+	^ self organization elements
 !
 
 sortedClasses
@@ -1373,10 +1386,6 @@ basicParse: aString
 	<return smalltalk.parser.parse(aString)>
 !
 
-classes
-	<return self.classes()>
-!
-
 parse: aString
 	| result | 
 	self try: [result := self basicParse: aString] catch: [:ex | (self parseError: ex parsing: aString) signal].
@@ -1415,6 +1424,10 @@ send: aSelector to: anObject arguments: aCollection
 
 !Smalltalk methodsFor: 'classes'!
 
+classes
+	<return self.classes()>
+!
+
 removeClass: aClass
 	aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!!'].
     
@@ -1424,7 +1437,7 @@ removeClass: aClass
 	aClass class methodDictionary values do: [:each |
 		aClass class removeCompiledMethod: each].
         
-	self basicDelete: aClass name.
+	self deleteClass: aClass.
     
     SystemAnnouncer current
     	announce: (ClassRemoved new
@@ -1492,6 +1505,12 @@ createPackage: packageName properties: aDict
        <return smalltalk.addPackage(packageName, object)>
 !
 
+deleteClass: aClass
+	"Deletes a class by deleting its binding only. Use #removeClass instead"
+    
+	<self.removeClass(aClass)>
+!
+
 deletePackage: packageName
 	"Deletes a package by deleting its binding, but does not check if it contains classes etc.
 	To remove a package, use #removePackage instead."