Just make sure that the first time the variable
IncomingMessageHandlers is seen in context
Sign, it already exists in
MAIN as a context name. Symbol trees made with
Tree and classes made with
Class are global symbols by it's nature. Once a global context symbol exists already, the context you are in will not create a new local variable with the same name unless you force it with the locale context as prefix. When
IncomingMessageHandlers then occurs it will automatically be interpreted as the global context symbol.
In the following example when you refer to
IncomingMessageHandlers the second time, it automatically refers to
MAIN:IncomingMessageHandlers without necessity of the
MAIN prefix, because
IncomingMessageHandlers now exists as a global context symbol.
Code: Select all
> (context 'Sign)
Sign
Sign> (new Tree 'MAIN:IncomingMessageHandlers)
IncomingMessageHandlers
Sign> (IncomingMessageHandlers "var" '(a b c))
(a b c)
Sign> (IncomingMessageHandlers "var")
(a b c)
Sign> (symbols)
(a b c) ; no IncomingMessageHandlers has been created locally
Sign>
Just make sure that the statement (new Tree ‘MAIN:IncomingMessageHandlers) is occurring on the top level of context Sign, the first time it occurs and that time it uses the MAIN prefix. Or as an alternative put the Tree creating statement into MAIN
before loading
Sign