help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] STInST Parser and parsing Glut (and other code)


From: Gwenaël Casaccio
Subject: Re: [Help-smalltalk] STInST Parser and parsing Glut (and other code)
Date: Mon, 23 Sep 2013 09:41:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

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
address@hidden
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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]