[squeak-dev] Monticello trickery: pointers needed

Frank Shearar frank.shearar at gmail.com
Sun Dec 25 22:18:49 UTC 2011


Hi,

The background to the question is that I'm trying to repackage
LanguageBoxes so that both the Squeak and Pharo community can use its
features (or just parts of it).

Cutie-Helvetia defines a class, CURaisedToExample. Among others, it
defines two methods: CURaisedToExample class >> #raise:to and
CURaisedToExample >> testSplice.

The latter makes use of QQCompiler's splice operation (just like
Common Lisp's) - @foo will replace 'foo' with whatever 'foo' evaluates
to, so compiling 'a := @(3 + 4)' means the same thing as 'a := 7'. Now
testSplice says

  self assert: `@(self raise: 2 to: -3) = (1/8).

which means that, _at_compile_time_, testSplice will invoke #raise:to:
(the self refers to the class-side method)... and at this point in
time #raise:to: has been compiled, but not installed. Compiling
#testSplice fails with a MessageNotUnderstood, and package loading
aborts.

My question is this: how can I work around this? Can I move the
installation of #raise:to: to a preload step?

Some hacks that spring to mind, and don't seem very pleasant, are:
* introduce a new superclass defining the method, put that in a
seperate package, and load that package before Cutie-Helvetia
* move the definition of CURaisedToExample and #raise:to: to a
separate package, and make all the tests extensions to that package.

frank



More information about the Squeak-dev mailing list