SharedPool.st
author Stefan Vogel <sv@exept.de>
Wed, 26 Jan 2005 15:41:06 +0100
changeset 8709 25088287bbd0
parent 8551 de314b9f8fa3
child 8728 d70396dc4e96
permissions -rw-r--r--
Catch #fromString: (for autoloaded classes from Dolphin)

"{ Package: 'stx:libbasic' }"

Object subclass:#SharedPool
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Kernel-Classes'
!

!SharedPool class methodsFor:'documentation'!

documentation
"
    A shared pool represents a set of bindings which are accessible to all classes
    which import the pool in its 'pool dictionaries'.
    SharedPool is NOT a dictionary but rather a name space.
    Bindings are represented by 'class variables' - as long as we have no better way to represent
    them at least.
"
! !

!SharedPool class methodsFor:'name lookup'!

bindingOf: varName
    "Answer the binding of some variable resolved in the scope of the receiver"

    | aSymbol binding |

self halt:'unfinished implementation'.
    aSymbol := varName asSymbol.

    "First look in classVar dictionary."
    binding := self classPool bindingOf: aSymbol.
    binding ifNotNil:[^binding].

    "Next look in shared pools."
    self sharedPools do:[:pool |
            binding := pool bindingOf: aSymbol.
            binding ifNotNil:[^binding].
    ].

    "subclassing and environment are not preserved"
    ^nil
!

bindingsDo: aBlock
self halt:'unfinished implementation'.
    ^ self classPool bindingsDo: aBlock
!

classBindingOf: varName
    "For initialization messages grant the regular scope"

self halt:'unfinished implementation'.
    ^super bindingOf: varName
!

includesKey:aSymbol
    ^ self keys includes:aSymbol

    "
     OpenGLConstants includesKey:#GL3Bytes
    "
!

keys
    ^ self classVarNames

    "
     OpenGLConstants keys
    "
! !

!SharedPool class methodsFor:'printing & storing'!

displayString
    "return a printed represenation - here, a reminder is appended,
     that this is not a regular class"

    self == SharedPool ifTrue:[
        ^ super displayString
    ].
    ^ self name , ' (* SharedPool *)'
! !

!SharedPool class methodsFor:'queries'!

isSharedPool
    ^ self ~~ SharedPool
! !

!SharedPool class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic/SharedPool.st,v 1.2 2004-09-20 08:47:24 ca Exp $'
! !