Class.st
branchjv
changeset 25410 c91ea94445d1
parent 25404 a215a0c88872
child 25418 81a37da4effd
--- a/Class.st	Wed Feb 03 06:58:24 2021 +0000
+++ b/Class.st	Wed Feb 03 11:52:30 2021 +0000
@@ -2,7 +2,7 @@
  COPYRIGHT (c) 1989 by Claus Gittinger
  COPYRIGHT (c) 2009-2010 Jan Vrany
  COPYRIGHT (c) 2015-2016 Jan Vrany
- COPYRIGHT (c) 2020 LabWare
+ COPYRIGHT (c) 2020-2021 LabWare
 	       All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -65,7 +65,7 @@
  COPYRIGHT (c) 1989 by Claus Gittinger
  COPYRIGHT (c) 2009-2010 Jan Vrany
  COPYRIGHT (c) 2015-2016 Jan Vrany
- COPYRIGHT (c) 2020 LabWare
+ COPYRIGHT (c) 2020-2021 LabWare
 	       All Rights Reserved
 
  This software is furnished under a license and may be used
@@ -505,6 +505,7 @@
 
 
 
+
 !Class methodsFor:'Compatibility-Dolphin'!
 
 defaultCategoryForDolphinClasses
@@ -5747,22 +5748,24 @@
 
 !Class::SimulatedClassPool methodsFor:'accessing'!
 
-associationAt:aName
+associationAt:aKey
+    "return an association consisting of aKey and the element indexed
+     by aKey -
+     report an error, if no element is stored under aKey"
+
+    ^ self associationAt:aKey ifAbsent:[self errorKeyNotFound:aKey]
+
+    "Modified: / 04-02-2000 / 00:27:40 / cg"
+    "Modified: / 03-02-2021 / 09:19:00 / Jan Vrany <jan.vrany@labware.com>"
+!
+
+associationAt:name ifAbsent:exceptionBlock
     "simulate an association"
 
-    ^ SimulatedVariableBinding key:aName value:(class classVarAt:aName)
-
-    "Modified: / 4.2.2000 / 00:27:40 / cg"
-!
-
-associationAt:aName ifAbsent:exceptionBlock
-    "simulate an association"
-
-    |internalName cls|
-
-    cls := class theNonMetaclass.
-    internalName := (cls name , ':' , aName) asSymbol.
-    ^ SimulatedVariableBinding key:internalName value:(cls classVarAt:aName)
+    | value |
+
+    value := class theNonMetaclass classVarAt: name ifAbsent: exceptionBlock.
+    ^ SimulatedVariableBinding key:name value:value
 
     "Created: / 3.2.2000 / 23:30:07 / cg"
     "Modified: / 4.2.2000 / 01:58:56 / cg"