Oddly bound variables in compiled methods...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Oddly bound variables in compiled methods...

Alejandro Fernandez-5
Hi,
  after a while trying to chase down a bug, I found out that a method that was apparently referring to an instance variable, was bound to a different one. Let me clarify:
I had a Person class with variables name and email. I had a setter method for name that correctly tried to assign (underscore assignment, in case that makes a difference) to the instance variable name. However, after the method executed, named remained nil, and the method argument had been assigned to email. I modified the setter (simply adding a space), saved it, and it started working well.
  Is that a common problem? How do I avoid it?
 I am using squeak 3.9 with a seaside-ready image sq3.9-7067web07.08.1.zip I got somewhere.
Regards,
Casco
 


--
Dr. Alejandro Fernández
LIFIA - Laboratorio de Investigación y Formación en Informática Avanzada
Facultad de Informática; Universidad Nacional de La Plata
Calles 50 y 115
La Plata - 1900
Argentina

Phone: +54 221 4228252 Ext: 218
e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Oddly bound variables in compiled methods...

keith1y
Alejandro Fernandez wrote:

> Hi,
>   after a while trying to chase down a bug, I found out that a method
> that was apparently referring to an instance variable, was bound to a
> different one. Let me clarify:
> I had a Person class with variables name and email. I had a setter
> method for name that correctly tried to assign (underscore assignment,
> in case that makes a difference) to the instance variable name.
> However, after the method executed, named remained nil, and the method
> argument had been assigned to email. I modified the setter (simply
> adding a space), saved it, and it started working well.
>   Is that a common problem? How do I avoid it?
>  I am using squeak 3.9 with a seaside-ready image
> sq3.9-7067web07.08.1.zip I got somewhere.
> Regards,
> Casco
It sounds like the package/classes concerned needs to be recompiled.
(There is a recompile package menu item in Monticello (context-menu of
the left pane of the main working copy/repository browser)).

This is a problem which used to occur occasionally when using Monticello
version 1.5, if a more recent version of a package re-orders instance
variables and compilation fails for some reason. This should have been
fixed in recent versions of MC1.5. If you are using MC1.5 and still have
this problem do let me know.

best regards

Keith