[Newbies] 'locking' an object

Randal L. Schwartz merlyn at stonehenge.com
Thu Oct 2 18:25:21 UTC 2008

>>>>> "Bert" == Bert Freudenberg <bert at freudenbergs.de> writes:

Bert> There is no magic in #instVarAt:. It exists merely for helping
Bert> debugging.

I meant the primitive it invokes.  Encapsulated magic is still magic.

>> So code would merely have to execute the equivalent of the  primitives behind
>> #instVarAt: and #instVarAt:put:, and no amount of wrapper class  would help.

Bert> All you need to do to prevent the debugger from accessing instance
Bert> variables is overwriting the methods the debugger invokes.

Ahh, but a determined outsider could still add methods to the class of the
object on the fly, hand-compiling them if necessary.

Unless you're now voting for an immutable method dictionary. :)

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

More information about the Beginners mailing list