[Squeak] Stupid question on messages sent to objects of same
type
Tim Olson
tim at jumpnet.com
Thu Aug 6 23:42:12 UTC 1998
>However, when I hit the multiplication in the mandelbrotStepsToInfinity:
>method (which sends a message to a temporary variable of ComplexNumber), the
>debugger kicks out a "does not understand message", when trying to multiply
>component parts of the ComplexNumber.
The problem is in the mandelbrotStepsToInfinity: method; there you create
a new Complex number with "new", rather than "new:imaginary:", thus the
instance variables "real" and "imaginary" aren't initialized. You should
either cause "new" to initialize these variables, or change the creation
code to use "new:imaginary:".
(the same problem exists in the other arithmetic methods).
-- tim
More information about the Squeak-dev
mailing list
|