[squeak-dev] Pragmas for Controlling Compiler

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

[squeak-dev] Pragmas for Controlling Compiler

Martin Beck-3
Hi,

are there pragmas for controlling whether the compiler will include
parts of the source code or not? For example:

test
   <compiler: off>
   TestClass new doSomething.
   <compiler: on>
   TestClass new doSomething muchBetter.

In fact, I want to use another compiler, which should only compile the
first line, while the normal Squeak compiler should only compile the
second. Any ideas?

Regards,
Martin

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Pragmas for Controlling Compiler

Klaus D. Witzel
On Mon, 17 Nov 2008 11:35:24 +0100, Martin Beck wrote:

> Hi,
>
> are there pragmas for controlling whether the compiler will include
> parts of the source code or not? For example:
>
> test
>    <compiler: off>
>    TestClass new doSomething.
>    <compiler: on>
>    TestClass new doSomething muchBetter.
>
> In fact, I want to use another compiler, which should only compile the
> first line, while the normal Squeak compiler should only compile the
> second. Any ideas?

Sure,

  OnOff
    ifTrue: [TestClass new doSomething]
    ifFalse: [TestClass new doSomething muchBetter]

/Klaus

> Regards,
> Martin
>

--
"If at first, the idea is not absurd, then there is no hope for it".  
Albert Einstein


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Pragmas for Controlling Compiler

Martin Beck-3
Hi,

Klaus D. Witzel wrote:
> Sure,
>
>  OnOff
>    ifTrue: [TestClass new doSomething]
>    ifFalse: [TestClass new doSomething muchBetter]

Ok, my fault. A simple (Smalltalk at: #TestClass) removes the direct
class dependency from the source code and my compiler won't choke about
it anymore.

Thx,
Martin