> On 5 Dec 2016, at 05:36, Nicolai Hess <[email protected]> wrote:
> 
> 
> 
> 2016-12-05 8:51 GMT+01:00 Nicolas Cellier <[email protected] 
> <mailto:[email protected]>>:
> Translate AST to byte codes?
> 
> (For opal, this first creates the intermediate representation (IR), but yes 
> translating from AST to (finally) byte codes)
>  
> One for the case when we don't care of the result (we will pop it off the 
> stack), we just want the effect.
> 
> Ok.
>  
> The other case when we want to keep the resulting value on the stack.
> 
> Who decides which to use, when do I know that I need to use, the effect 
> translator only or the value translator?
>  

Sorry for not answering, I was travelling and now catching up with emails.

The decision to visit “for effect only” or “for value” is taken by the visitor 
depending on what part of the
ast it is visiting.

> 
> @Marcus,
> can we *always* use the valueTranslator when visiting a link preamble ?
> (I tried this, the above method now works, and all tests are green, but I am 
> not sure if this is the right solution).
> 

Yes, I think so. The idea is that the preamble is just about stack 
manipulation, so we actually are not interested
in e.g. popping off the result after a send where the value is not needed.

I will commit a slide with the fix.

        Marcus

Reply via email to