Class.st
branchjv
changeset 25410 c91ea94445d1
parent 25404 a215a0c88872
child 25418 81a37da4effd
equal deleted inserted replaced
25409:8926491e9d6f 25410:c91ea94445d1
     1 "
     1 "
     2  COPYRIGHT (c) 1989 by Claus Gittinger
     2  COPYRIGHT (c) 1989 by Claus Gittinger
     3  COPYRIGHT (c) 2009-2010 Jan Vrany
     3  COPYRIGHT (c) 2009-2010 Jan Vrany
     4  COPYRIGHT (c) 2015-2016 Jan Vrany
     4  COPYRIGHT (c) 2015-2016 Jan Vrany
     5  COPYRIGHT (c) 2020 LabWare
     5  COPYRIGHT (c) 2020-2021 LabWare
     6 	       All Rights Reserved
     6 	       All Rights Reserved
     7 
     7 
     8  This software is furnished under a license and may be used
     8  This software is furnished under a license and may be used
     9  only in accordance with the terms of that license and with the
     9  only in accordance with the terms of that license and with the
    10  inclusion of the above copyright notice.   This software may not
    10  inclusion of the above copyright notice.   This software may not
    63 copyright
    63 copyright
    64 "
    64 "
    65  COPYRIGHT (c) 1989 by Claus Gittinger
    65  COPYRIGHT (c) 1989 by Claus Gittinger
    66  COPYRIGHT (c) 2009-2010 Jan Vrany
    66  COPYRIGHT (c) 2009-2010 Jan Vrany
    67  COPYRIGHT (c) 2015-2016 Jan Vrany
    67  COPYRIGHT (c) 2015-2016 Jan Vrany
    68  COPYRIGHT (c) 2020 LabWare
    68  COPYRIGHT (c) 2020-2021 LabWare
    69 	       All Rights Reserved
    69 	       All Rights Reserved
    70 
    70 
    71  This software is furnished under a license and may be used
    71  This software is furnished under a license and may be used
    72  only in accordance with the terms of that license and with the
    72  only in accordance with the terms of that license and with the
    73  inclusion of the above copyright notice.   This software may not
    73  inclusion of the above copyright notice.   This software may not
   498     ^ self == Class class or:[self == Class]
   498     ^ self == Class class or:[self == Class]
   499 
   499 
   500     "Created: 15.4.1996 / 17:17:13 / cg"
   500     "Created: 15.4.1996 / 17:17:13 / cg"
   501     "Modified: 23.4.1996 / 15:56:58 / cg"
   501     "Modified: 23.4.1996 / 15:56:58 / cg"
   502 ! !
   502 ! !
       
   503 
   503 
   504 
   504 
   505 
   505 
   506 
   506 
   507 
   507 
   508 
  5745 "
  5746 "
  5746 ! !
  5747 ! !
  5747 
  5748 
  5748 !Class::SimulatedClassPool methodsFor:'accessing'!
  5749 !Class::SimulatedClassPool methodsFor:'accessing'!
  5749 
  5750 
  5750 associationAt:aName
  5751 associationAt:aKey
       
  5752     "return an association consisting of aKey and the element indexed
       
  5753      by aKey -
       
  5754      report an error, if no element is stored under aKey"
       
  5755 
       
  5756     ^ self associationAt:aKey ifAbsent:[self errorKeyNotFound:aKey]
       
  5757 
       
  5758     "Modified: / 04-02-2000 / 00:27:40 / cg"
       
  5759     "Modified: / 03-02-2021 / 09:19:00 / Jan Vrany <jan.vrany@labware.com>"
       
  5760 !
       
  5761 
       
  5762 associationAt:name ifAbsent:exceptionBlock
  5751     "simulate an association"
  5763     "simulate an association"
  5752 
  5764 
  5753     ^ SimulatedVariableBinding key:aName value:(class classVarAt:aName)
  5765     | value |
  5754 
  5766 
  5755     "Modified: / 4.2.2000 / 00:27:40 / cg"
  5767     value := class theNonMetaclass classVarAt: name ifAbsent: exceptionBlock.
  5756 !
  5768     ^ SimulatedVariableBinding key:name value:value
  5757 
       
  5758 associationAt:aName ifAbsent:exceptionBlock
       
  5759     "simulate an association"
       
  5760 
       
  5761     |internalName cls|
       
  5762 
       
  5763     cls := class theNonMetaclass.
       
  5764     internalName := (cls name , ':' , aName) asSymbol.
       
  5765     ^ SimulatedVariableBinding key:internalName value:(cls classVarAt:aName)
       
  5766 
  5769 
  5767     "Created: / 3.2.2000 / 23:30:07 / cg"
  5770     "Created: / 3.2.2000 / 23:30:07 / cg"
  5768     "Modified: / 4.2.2000 / 01:58:56 / cg"
  5771     "Modified: / 4.2.2000 / 01:58:56 / cg"
  5769 !
  5772 !
  5770 
  5773