Re: [Pharo-users] casting to subclass

2018-03-06 Thread Siemen Baader
On Fri, Mar 2, 2018 at 9:19 PM, Hernán Morales Durand < hernan.mora...@gmail.com> wrote: > Hi Siemen > > IIRC this was known as "wide classes", there is some paper about it. > Thanks for the pointer! I found http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.31.4708 but no Pharo

Re: [Pharo-users] casting to subclass

2018-03-06 Thread Siemen Baader
On Fri, Mar 2, 2018 at 9:21 PM, Esteban A. Maringolo wrote: > "Castings" are aliens in the Smalltalk world, although there is a > #become*: method family, I would discourage you from using it as an > alternative unless you really need to do it. > Ok, thanks. I think this

Re: [Pharo-users] casting to subclass

2018-03-06 Thread Siemen Baader
On Fri, Mar 2, 2018 at 9:08 PM, Stephan Eggermont wrote: > Siemen Baader wrote: > > > > What else could I do, apart from removing the element from its tree, > > creating a new (subclass) instance and then putting this element in place > > of the old

Re: [Pharo-users] casting to subclass

2018-03-02 Thread Esteban A. Maringolo
"Castings" are aliens in the Smalltalk world, although there is a #become*: method family, I would discourage you from using it as an alternative unless you really need to do it. If your use case is that concrete, I'd do something like: `ILHTMLBuilderElement fromXMLElement: anXMLElement` Then

Re: [Pharo-users] casting to subclass

2018-03-02 Thread Hernán Morales Durand
Hi Siemen IIRC this was known as "wide classes", there is some paper about it. Cheers, Hernán 2018-03-02 15:45 GMT-03:00 Siemen Baader : > Hi all, > > it seems like we cannot cast the class of object to its subclass if that > subclass has had new instance variables added

Re: [Pharo-users] casting to subclass

2018-03-02 Thread Stephan Eggermont
Siemen Baader wrote: > > What else could I do, apart from removing the element from its tree, > creating a new (subclass) instance and then putting this element in place > of the old one? Some #perform or `super` magic..? Use composition? Generate accessing code where

[Pharo-users] casting to subclass

2018-03-02 Thread Siemen Baader
Hi all, it seems like we cannot cast the class of object to its subclass if that subclass has had new instance variables added to it: http://forum.world.st/changing-the-class-of-an-existing-object-to-a-subclass-td4239041.html But I (think) I need it - I'm transforming a DOM tree from