On 22/09/2013 13:13, Holger Hans Peter Freyther wrote:
On Sun, Sep 22, 2013 at 12:45:09PM +0200, Paolo Bonzini wrote:

GPPlot is something that you add to a GNUPlot instance.  I guess we have
to fix the problem, we cannot do the same as Cairo.
How do you define the semantic?

Namespace current: GNUPlot [
        Object subclass: GNUPlot [
                Foo := nil.

                foo [
                        ^GNUPlot.Foo
                ]

                bla [
                        ^Foo
                ]
        ]

        Object subclass: SomethingPlog [
                foo [
                        ^GNUPlot.Foo
                ]
        ]

        Object subclass: Foo [
                
        ]
]


  >>#bla and >>#foo the bytecode appears to be:

     [3]        source code line number 2
        push Global Variable #Foo->nil
     [5]        return stack top

Which means foo is resolved at runtime that one can never access
a class variable?


holger

_______________________________________________
help-smalltalk mailing list
help-smalltalk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Hi,

if we accept that the class name *cannot* be the same as the namespace name hence the code becomes:

Namespace current: GNUPlot [
    Gplot >> foo [
    ^GNUPlot.Foo
    ]
]


The compiler will create a DeferedVariableBinding and when Foo class is created it replaces the DeferedVariableBinding with a VariableBinding.

Gwen


_______________________________________________
help-smalltalk mailing list
help-smalltalk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to