Self modifying systems question

Bijan Parsia bparsia at
Tue Apr 29 14:19:57 UTC 2003

On Tue, 29 Apr 2003, Sten Kvamme wrote:

> Hello,
> Self modifying code is a well known technology. Has anyone done this in
> Squeak? What I'm seeking for is examples of software that adds to
> itself (methods and variables) in runtime.

Given that ALL the IDE in Squeak is Squeak hosted and written in Squeak,
the answer is a BIG ole "yes".

Basically, ANY Squeaking that you do involves modification of the in
memory system, on the fly. It could be a motto: Squeak --
self-modification out the wazoo.

> I understand from reading the Squeak documentation that it is easy
> to add a variable to a running object instance for a developer, but
> is it also possible to do from code without any developer around?

Start looking at the Behavior heirarchy.

For the less faintheart (or the wise) you can always roll your own
dispatcher, either directly or by doesNotUnderstand trapping. Just keep a
dicitonary of blocks (and, perhaps, another dictionary of other values to
simulate variables).

Feels like Python! :)

Bijan Parsia.

More information about the Squeak-dev mailing list