Enviado: jueves, agosto 28, 2014 08:02 a.m.
> Para: Any question about pharo is welcome
> Asunto: Re: [Pharo-users] Unintuitive behavior of class-side initialize
>
> you can read the book here
>
> https://www.gitbook.io/book/kilon/pbe
>
> main repo is here
>
> https:
Le 27 août 2014 à 19:04, p...@highoctane.be a écrit :
> Yeah don't do super initialize unless you know why on the class side.
>
> That being said class side initialize is pretty cool when loading new
> packages and setting everything up automagically.
>
In my opinion, it would be better to hav
, agosto 28, 2014 08:02 a.m.
Para: Any question about pharo is welcome
Asunto: Re: [Pharo-users] Unintuitive behavior of class-side initialize
you can read the book here
https://www.gitbook.io/book/kilon/pbe
main repo is here
https://github.com/SquareBracketAssociates/UpdatedPharoByExample
Sure
> the updated book.
> Best
> Nacho
>
> Enviado desde Molto <http://www.moltoapp.com/app?tag=ipad_sig> para iPad
>
> De: kilon alios
> Enviado: miércoles, agosto 27, 2014 09:50 a.m.
> Para: Any question about pharo is welcome
> Asunto: Re: [Pharo-users] Unintui
d
De: kilon alios
Enviado: miércoles, agosto 27, 2014 09:50 a.m.
Para: Any question about pharo is welcome
Asunto: Re: [Pharo-users] Unintuitive behavior of class-side initialize
I will be adding an "Introduction to Object Orientation" chapter to the new
updated Pharo By Example online
I assume you mean there will be an inheritance issue if I want the
variables to be inherited with a default value by the subclasses, which is
a valid concern. Other than that you can have accessors for it as far I
know . But yeah in that case of inheritance you need some kind of
initialise method.
webwarrior wrote:
As class is just an object in Smalltalk, it would be reasonable to believe
that #initialize message is always sent to class on creation.
However, that's not true. It is only sent to classes that redefine
#initialize. Also sending super initialize may lead to problems.
None of
I've also chosen ifNil route.
However, in that case you either:
- break encapsulation by providing accessors
- have to invoke initializing method in every method that uses class
instance variables or class variables
27.08.2014 20:31, kilon.alios [via Smalltalk] написав(ла):
> yeah python does not
yeah python does not need initialisation for class variables like it does
for instance variables, but then same applies for instance variables, for
example you can add instance variables and even instance method after the
instance is created , pharo does something similar too.
Well OOP is a deep s
Yeah don't do super initialize unless you know why on the class side.
That being said class side initialize is pretty cool when loading new
packages and setting everything up automagically.
Phil
Le 27 août 2014 18:33, "webwarrior" a écrit :
> class-side initialize.
>
> I don't think it can be c
class-side initialize.
I don't think it can be considered a metaprogramming in Smalltalk.
In Python, yes, messing with metaclass is metaprogramming. But things
are a bit different there and metaclasses are very rarely used [explicitly].
27.08.2014 19:05, kilon.alios [via Smalltalk] написав(ла):
ok officially I am confused are we talking about initialise at the instance
side or class side (metaclass) side ?
I am a python coder myself but I have not done any metaprogramming .
If it is a metaprogramming thing then yes it wont go inside my intro
chapter since this is advanced topic and me
This is not something fundamental to OOP, just specific to Pharo or
Smalltalk.
Take for example Python. It has similar object model (objects, classes,
metaclasses). Every time class is defined (either by class keyword, or
by type() function, or by calling a metaclass), its metaclass' __init__
I will be adding an "Introduction to Object Orientation" chapter to the new
updated Pharo By Example online book, so I will add this to the chapter.
The chapter will target people not familiar with Object Orientation and
people new to coding. Its not an immediate target but it will happen till
the
On Wed, Aug 27, 2014 at 8:22 AM, webwarrior wrote:
> As class is just an object in Smalltalk, it would be reasonable to believe
> that #initialize message is always sent to class on creation.
>
> However, that's not true. It is only sent to classes that redefine
> #initialize. Also sending super
As class is just an object in Smalltalk, it would be reasonable to believe
that #initialize message is always sent to class on creation.
However, that's not true. It is only sent to classes that redefine
#initialize. Also sending super initialize may lead to problems.
None of these is mentioned i
16 matches
Mail list logo