[Pharo-project] compiled method inherits from Collection?
(Object>>#name) isCollection = true Actually is a subclass of ByteArray (instead of collaborating with one). Does this seem strange to anybody else? Is it really needed? Fernando
On 19 June 2012 10:27, Fernando Olivero <fernando.olivero@usi.ch> wrote:
(Object>>#name) isCollection = true
Actually is a subclass of ByteArray (instead of collaborating with one).
Does this seem strange to anybody else? Is it really needed?
Yes, I found it a bit strange: http://bugs.squeak.org/view.php?id=7570. As I understand it, CompiledMethod isKindOf: ByteArray just because it uses a lot of ByteArray's methods. It's a case of subclassing for code reuse, because otherwise one would have to implement a bunch of ByteArray-like methods in CompiledMethod. frank
Fernando
Frank Shearar wrote:
On 19 June 2012 10:27, Fernando Olivero<fernando.olivero@usi.ch> wrote:
(Object>>#name) isCollection = true
Actually is a subclass of ByteArray (instead of collaborating with one).
Does this seem strange to anybody else? Is it really needed?
Yes, I found it a bit strange: http://bugs.squeak.org/view.php?id=7570. As I understand it, CompiledMethod isKindOf: ByteArray just because it uses a lot of ByteArray's methods. It's a case of subclassing for code reuse,
Shouldn't this be better solved by a trait encapsulating that reused code? Herby
because otherwise one would have to implement a bunch of ByteArray-like methods in CompiledMethod.
frank
Fernando
On Jun 19, 2012, at 11:28 AM, Fernando Olivero wrote:
(Object>>#name) isCollection = true
Actually is a subclass of ByteArray (instead of collaborating with one).
Does this seem strange to anybody else? Is it really needed?
CompiledMethods are magical. They are highly optimized for saving space. If this is needed in 2012 where even a cellphone has half a gig of RAM is something that people are highly opinionated about. And the special format of CompiledMethod is something the VM knows. So: any change here means deep VM changes. Marcus -- Marcus Denker -- http://marcusdenker.de
participants (4)
-
Fernando Olivero -
Frank Shearar -
Herby VojÄÃk -
Marcus Denker