[Newbies] Re: perform withArguments

Bert Freudenberg bert at freudenbergs.de
Tue Apr 24 20:18:33 UTC 2012

On 24.04.2012, at 11:34, Louis LaBrunda wrote:

>> .. I had thought there might be a way of "building up" the "cellObject
>> cellLock: aBoolean" ... judging from the replies, it seems that it is
>> either a) crazy, b) it can't be done, c) no one knows how to do it.
> I don't know if I would say it is crazy but some might.  Mostly I use VA
> Smalltalk, it is designed more for business use that Squeak is (that's not
> a knock on Squeak, it's just the way it is).  In VA Smalltalk the compiler
> is not included with the packaged images.  In Squeak, you always live in
> the image with the compiler.  I expect there is a way to build up a string
> that might look like this: "cell1 cellLock: true" and then send it to the
> compiler and then execute the compiled code returned by the compiler.  I
> bet Bert and many other in the group know how to do this.  But once you
> play with collections, you will see it is not needed.

Hah! Using the compiler is even more crazy than the meta programming facilities (thisContext, instVarNamed:). But yes, it's possible:

Compiler new evaluate: 'cell1 cellLock: true' in: thisContext to: self

- Bert -

More information about the Beginners mailing list