[Grace-core] Traits as non-objects

Marco Servetto marco.servetto at gmail.com
Mon Mar 18 14:29:42 PDT 2013


>>-I'm pretty sure Eiffel's rename (and I imagine Marco's work) "deeply" renames methods..
In order to comment here, I readed yust the piece of the proposal
about renaming.
The "deep rename" is a non trivial issue.
While a naive implementation simply rename in the cloned method from x
to y the self.x into self.y,
keeping the meaning of direct recursion,
still have no way to fix indirect recursions.

In a world without nested classes (or when the trait operators does
not works over methods over nested traits/classes)
than you can rename all the self.x occurences and the method
declaration, and obtaining a full rename, that does not preserve the
old method.
In a world with deep trait operator a nominal type system is required
(or something that keep trace of where a method is born, like the
first declaration of a method in a java interface) and the rename
operator have to act of the original point of the method,; then the
rename can be applied in a similar fascion w.r.t. the well known
refactoring rename.


More information about the Grace-core mailing list