Workspace-like bindings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Workspace-like bindings

Stéphane Rollandin
I am trying with no luck so far to implement object-specific bindings
such as workspace ones.

I would like something like

        Compiler evaluate in: anObject

to take into account local bindings in anObject, as returned (I guess)
from anObject>> #bindingOf:


any idea ?


Stef



Reply | Threaded
Open this post in threaded view
|

Re: Workspace-like bindings

Stéphane Rollandin
answering to myself... I eventually found out that

        Compiler evaluate: aString
                for: anObject notifying: anObject logged: false

does what I want provided that anObject class implements #bindingOf:
plus a dummy method #text returning ' ' and a dummy #selectionInterval
returning (1 to: 1).

this is because methods #temporariesIn: and #removeUnusedTemps in Parser
require the requestor to handle those messages. this could be changed
IMHO, so that simply providing bindingOf: does the job.

should I report this in Mantis, or did I miss something ?


Stef

> I am trying with no luck so far to implement object-specific bindings
> such as workspace ones.
>
> I would like something like
>
>     Compiler evaluate in: anObject
>
> to take into account local bindings in anObject, as returned (I guess)
> from anObject>> #bindingOf:
>
>
> any idea ?
>
>
> Stef
>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Workspace-like bindings

Klaus D. Witzel
Hi Stef,

on Fri, 26 May 2006 16:43:58 +0200, you <[hidden email]> wrote:

> answering to myself... I eventually found out that
>
> Compiler evaluate: aString
> for: anObject notifying: anObject logged: false
>
> does what I want provided that anObject class implements #bindingOf:  
> plus a dummy method #text returning ' ' and a dummy #selectionInterval  
> returning (1 to: 1).
>
> this is because methods #temporariesIn: and #removeUnusedTemps in Parser  
> require the requestor to handle those messages. this could be changed  
> IMHO, so that simply providing bindingOf: does the job.
>
> should I report this in Mantis, or did I miss something ?

This depends on what you want requestor (the argument to notifying:) to  
do, in case of Syntax errors and the like. Try

> Compiler evaluate: aString
> for: anObject notifying: nil logged: false

and #text and #selectionInterval will not be asked for.

/Klaus

> Stef


Reply | Threaded
Open this post in threaded view
|

Re: Workspace-like bindings

Stéphane Rollandin

> This depends on what you want requestor (the argument to notifying:) to
> do, in case of Syntax errors and the like. Try
>
>>     Compiler evaluate: aString
>>         for: anObject notifying: nil logged: false
>
> and #text and #selectionInterval will not be asked for.


I need the requestor because it provides its bindings...
see Parser>>correctVariable:interval:

regards,

Stef