On 25 Feb 2016, at 13:34, Clément Bera <bera.clement@gmail.com> wrote:
Hi,
when redefining new you don't have to use super:
BlElement class>>new ^ self basicNew basicSpace: BlUniverse default runningSpace; initialize; yourself
IMO that's a better practice that redefining basicNew.
I just sent the same example ;)
Usually basicNew is only redefined when you cannot instantiate the objects using the normal API because it is not supported by the runtime (SmallInteger, Context, etc.)
2016-02-25 12:33 GMT+01:00 Alain Plantec via Pharo-dev <pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>>:
---------- Message transféré ---------- From: Alain Plantec <alain.plantec@yahoo.com <mailto:alain.plantec@yahoo.com>> To: Pharo Development List <pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>> Cc: Date: Thu, 25 Feb 2016 12:37:59 +0100 Subject: Re: [Pharo-dev] [bloc] why redefining new is not enough?
On 25 févr. 2016, at 11:49, Esteban Lorenzano <estebanlm@gmail.com <mailto:estebanlm@gmail.com>> wrote:
this is bad⦠redefining basicNew should not be done, never, never, never. why ?
thatâs why we have new and basicNew :)
the space may be needed during #initialize. this is why the initialization of the space is done in basicNew. But ok, we will fix that. Thanks Alain
Esteban
On 25 Feb 2016, at 09:52, stepharo <stepharo@free.fr <mailto:stepharo@free.fr>> wrote:
BlElement class>>basicNew "Redefined to set the space of the element"
^ super basicNew basicSpace: BlUniverse default runningSpace
why redefining new is not enough?
Ok now back to the mooc videos :(