Squeak: Compiler evaluate: '3+4' Pharo equivalent = ?

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

Squeak: Compiler evaluate: '3+4' Pharo equivalent = ?

Hannes Hirzel
Hello

What is the Pharo equivalent of the Squeak expression

     Compiler evaluate: '3+4'

?

Thank you for the answer in advance

--Hannes

Reply | Threaded
Open this post in threaded view
|

Re: Squeak: Compiler evaluate: '3+4' Pharo equivalent = ?

Sven Van Caekenberghe-2
I believe the idea is to ask yourself for your compiler

  self class compiler evaluate: '1+2'

So I guess, globally the following would do

  Smalltalk compiler evaluate: '1+2'.

This I infer by looking at the implementors of #compiler

> On 6 Oct 2018, at 18:30, H. Hirzel <[hidden email]> wrote:
>
> Hello
>
> What is the Pharo equivalent of the Squeak expression
>
>     Compiler evaluate: '3+4'
>
> ?
>
> Thank you for the answer in advance
>
> --Hannes
>


Reply | Threaded
Open this post in threaded view
|

Re: Squeak: Compiler evaluate: '3+4' Pharo equivalent = ?

Ben Coman
In reply to this post by Hannes Hirzel


On Sun, 7 Oct 2018 at 00:31, H. Hirzel <[hidden email]> wrote:
Hello

What is the Pharo equivalent of the Squeak expression

     Compiler evaluate: '3+4'

The direct equivalent is 
    OpalCompiler evaluate: '3+4' 

but Sven's answer is more in line with good practice.

cheers -ben