SharedPool.st
branchjv
changeset 17732 a1892eeca6c0
parent 17711 39faaaf888b4
child 17734 406b1590afe8
equal deleted inserted replaced
17731:295728e8f410 17732:a1892eeca6c0
    38 "
    38 "
    39     A shared pool represents a set of bindings which are accessible to all classes
    39     A shared pool represents a set of bindings which are accessible to all classes
    40     which import the pool in its 'pool dictionaries'.
    40     which import the pool in its 'pool dictionaries'.
    41     SharedPool is NOT a dictionary but rather a name space.
    41     SharedPool is NOT a dictionary but rather a name space.
    42     Bindings are represented by 'class variables' - as long as we have no better way to represent
    42     Bindings are represented by 'class variables' - as long as we have no better way to represent
    43     them at least.
    43     them at least. This is done to make stc happy (or at least, to not be forced to adapt it
       
    44     to any new semantics).
    44 "
    45 "
    45 ! !
    46 ! !
    46 
    47 
    47 !SharedPool class methodsFor:'Compatibility-V''Age'!
    48 !SharedPool class methodsFor:'Compatibility-V''Age'!
    48 
    49 
    56     self classVarAt:constantName put:value.
    57     self classVarAt:constantName put:value.
    57 ! !
    58 ! !
    58 
    59 
    59 !SharedPool class methodsFor:'name lookup'!
    60 !SharedPool class methodsFor:'name lookup'!
    60 
    61 
       
    62 at:name
       
    63     "retrieve a pool variable by name"
       
    64 
       
    65     ^ self at:name ifAbsent:[self errorKeyNotFound:name]
       
    66 !
       
    67 
    61 at:name ifAbsent:aBlock
    68 at:name ifAbsent:aBlock
       
    69     "retrieve a pool variable by name"
       
    70 
    62     (self includesKey:name) ifFalse:[^ aBlock value].
    71     (self includesKey:name) ifFalse:[^ aBlock value].
    63     ^ self classVarAt:name
    72     ^ self classVarAt:name
    64 !
    73 !
    65 
    74 
    66 bindingOf: varName
    75 bindingOf: varName
   136 ! !
   145 ! !
   137 
   146 
   138 !SharedPool class methodsFor:'documentation'!
   147 !SharedPool class methodsFor:'documentation'!
   139 
   148 
   140 version
   149 version
   141     ^ '$Id: SharedPool.st 10447 2009-06-14 13:09:55Z vranyj1 $'
   150     ^ '$Id: SharedPool.st 10473 2009-10-24 15:48:19Z vranyj1 $'
       
   151 !
       
   152 
       
   153 version_CVS
       
   154     ^ '§Header: /cvs/stx/stx/libbasic/SharedPool.st,v 1.8 2009/10/12 19:09:14 cg Exp §'
   142 ! !
   155 ! !
       
   156