Re: how to change the type of objects

2006-11-13 Thread TSa
HaloO, Darren Duncan wrote: What is the point of declaring a type as Rectangle, with those limitations, if you are going to mutate it into not being a Rectangle. There are three issues: 1) the subtyping relation 2) the preservation of object identity 3) the mutating add_vertex method Callin

Re: how to change the type of objects

2006-11-10 Thread Darren Duncan
At 1:24 PM +0100 11/10/06, TSa wrote: HaloO, I wonder how an object can change its type without loosing its identity. Consider two types Rectangle and Polygon with Rectangle a subtype of Polygon. Now if there is a method add_vertex in the Polygon type, calling it on a Rectangle warps the object

how to change the type of objects

2006-11-10 Thread TSa
HaloO, I wonder how an object can change its type without loosing its identity. Consider two types Rectangle and Polygon with Rectangle a subtype of Polygon. Now if there is a method add_vertex in the Polygon type, calling it on a Rectangle warps the object out of the Rectangle type into a Polygo