Re: [Pharo-users] When a metaclass is initialised by the system ?

2015-12-09 Thread Thierry Goubier

Le 09/12/2015 11:22, stepharo a écrit :

It would be good to add a preLoad and postLoad hook in the Manifest


+1

Thierry


Stef

Le 8/12/15 16:53, Christophe Demarey a écrit :

yes, we miss a package initialize method ...

Le 8 déc. 2015 à 16:35, Mariano Martinez Peck a écrit :


Dimitris,

Relying in class side initialize is not very cool. Mostly, because
it's hard to know EXACTLY when Monticello will send it. For sure it's
the first time you load that class. But then it could be if such
method changes again. But maybe too if you clear some Monticello
caches...
Also, you may have dependencies (of order execution) with other class
side initialize. So...another approaches you can take (depending on
your needs) is lazy class var getters with ifNil:   or  if you have a
ConfigurationOfYourApp, you can define #postLoadDoIts in which you
can perform the whole initialization of your app. Or ...from the
#postLoadDoIts simply delegate to a class MyAppInitialize.

I do a bit of all of them hahaha.

Cheers,

On Mon, Dec 7, 2015 at 9:11 PM, Dimitris Chloupis
<kilon.al...@gmail.com> wrote:

ok that means  I cannot rely on it and I will have to initialize
my class variables in specific methods. No problem, ifNil here I
come :)

On Tue, Dec 8, 2015 at 12:24 AM Sven Van Caekenberghe
<s...@stfx.eu> wrote:

Hi Dimitris,

> On 07 Dec 2015, at 23:12, Dimitris Chloupis
mailto:kilon.al...@gmail.com>> wrote:
>
> I have read that a metaclass (class side of the class) is
initialised when its loaded to the image by monticello, Are
there any other cases when the initialize method of the the
metaclass is being called ?

Correct: a class #initialize is called when its code is
loaded, but only if it is not yet present or different in
source code from what is already present (this last point
will bite you one day ;-).

Else, the #initialize should be called manually (for example
to reload some caches, or reset some system state). This
sometimes happens in #postLoads or install scripts.

I am not aware of any automatic invocations.

Sven







--
Mariano
http://marianopeck.wordpress.com 









Re: [Pharo-users] When a metaclass is initialised by the system ?

2015-12-09 Thread stepharo

It would be good to add a preLoad and postLoad hook in the Manifest

Stef

Le 8/12/15 16:53, Christophe Demarey a écrit :

yes, we miss a package initialize method ...

Le 8 déc. 2015 à 16:35, Mariano Martinez Peck a écrit :


Dimitris,

Relying in class side initialize is not very cool. Mostly, because 
it's hard to know EXACTLY when Monticello will send it. For sure it's 
the first time you load that class. But then it could be if such 
method changes again. But maybe too if you clear some Monticello 
caches...
Also, you may have dependencies (of order execution) with other class 
side initialize. So...another approaches you can take (depending on 
your needs) is lazy class var getters with ifNil:   or  if you have a 
ConfigurationOfYourApp, you can define #postLoadDoIts in which you 
can perform the whole initialization of your app. Or ...from the 
#postLoadDoIts simply delegate to a class MyAppInitialize.


I do a bit of all of them hahaha.

Cheers,

On Mon, Dec 7, 2015 at 9:11 PM, Dimitris Chloupis 
mailto:kilon.al...@gmail.com>> wrote:


ok that means  I cannot rely on it and I will have to initialize
my class variables in specific methods. No problem, ifNil here I
come :)

On Tue, Dec 8, 2015 at 12:24 AM Sven Van Caekenberghe
mailto:s...@stfx.eu>> wrote:

Hi Dimitris,

> On 07 Dec 2015, at 23:12, Dimitris Chloupis
mailto:kilon.al...@gmail.com>> wrote:
>
> I have read that a metaclass (class side of the class) is
initialised when its loaded to the image by monticello, Are
there any other cases when the initialize method of the the
metaclass is being called ?

Correct: a class #initialize is called when its code is
loaded, but only if it is not yet present or different in
source code from what is already present (this last point
will bite you one day ;-).

Else, the #initialize should be called manually (for example
to reload some caches, or reset some system state). This
sometimes happens in #postLoads or install scripts.

I am not aware of any automatic invocations.

Sven







--
Mariano
http://marianopeck.wordpress.com 






Re: [Pharo-users] When a metaclass is initialised by the system ?

2015-12-09 Thread Thierry Goubier

Le 09/12/2015 00:15, Mariano Martinez Peck a écrit :



On Tue, Dec 8, 2015 at 6:23 PM, Thierry Goubier
mailto:thierry.goub...@gmail.com>> wrote:

Le 08/12/2015 16:53, Christophe Demarey a écrit :

yes, we miss a package initialize method ...


FileTree, GitFileTree and probably Monticello have support for a
package initialize method.



mm package initialize method in Monticello?  I never saw that. Could
you share more details please?


What I see is the following files that are checked when loading a 
FileTree or GitFileTree package:


#('initializers*' 'preamble.st' 'postscript.st' 'preambleOfRemoval*' 
'postscriptOfRemoval*')


As far as I can follow the code, initializers relates to class 
initialization (calls to the various class initializers are written there?).


Package initialize would be postscript.st.

Thierry



Now, when I was doing my browser, I wondered about giving access to
such code... turns out nobody uses it.

Thierry


Le 8 déc. 2015 à 16:35, Mariano Martinez Peck a écrit :

Dimitris,

Relying in class side initialize is not very cool. Mostly,
because
it's hard to know EXACTLY when Monticello will send it. For
sure it's
the first time you load that class. But then it could be if such
method changes again. But maybe too if you clear some
Monticello caches...
Also, you may have dependencies (of order execution) with
other class
side initialize.  So...another approaches you can take
(depending on
your needs) is lazy class var getters with ifNil:   or  if
you have a
ConfigurationOfYourApp, you can define #postLoadDoIts in
which you can
perform the whole initialization of your app. Or ...from the
#postLoadDoIts simply delegate to a class MyAppInitialize.

I do a bit of all of them hahaha.

Cheers,

On Mon, Dec 7, 2015 at 9:11 PM, Dimitris Chloupis
mailto:kilon.al...@gmail.com>
>> wrote:

 ok that means  I cannot rely on it and I will have to
initialize
 my class variables in specific methods. No problem,
ifNil here I
 come :)

 On Tue, Dec 8, 2015 at 12:24 AM Sven Van Caekenberghe
 mailto:s...@stfx.eu>
>> wrote:

 Hi Dimitris,

 > On 07 Dec 2015, at 23:12, Dimitris Chloupis
 mailto:kilon.al...@gmail.com> >> wrote:
 >
 > I have read that a metaclass (class side of the
class) is
 initialised when its loaded to the image by
monticello, Are
 there any other cases when the initialize method of
the the
 metaclass is being called ?

 Correct: a class #initialize is called when its code is
 loaded, but only if it is not yet present or
different in
 source code from what is already present (this last
point will
 bite you one day ;-).

 Else, the #initialize should be called manually
(for example
 to reload some caches, or reset some system state).
This
 sometimes happens in #postLoads or install scripts.

 I am not aware of any automatic invocations.

 Sven







--
Mariano
http://marianopeck.wordpress.com








--
Mariano
http://marianopeck.wordpress.com





Re: [Pharo-users] When a metaclass is initialised by the system ?

2015-12-08 Thread Mariano Martinez Peck
On Tue, Dec 8, 2015 at 6:23 PM, Thierry Goubier 
wrote:

> Le 08/12/2015 16:53, Christophe Demarey a écrit :
>
>> yes, we miss a package initialize method ...
>>
>
> FileTree, GitFileTree and probably Monticello have support for a package
> initialize method.
>
>

mm package initialize method in Monticello?  I never saw that. Could
you share more details please?



> Now, when I was doing my browser, I wondered about giving access to such
> code... turns out nobody uses it.
>
> Thierry
>
>
>> Le 8 déc. 2015 à 16:35, Mariano Martinez Peck a écrit :
>>
>> Dimitris,
>>>
>>> Relying in class side initialize is not very cool. Mostly, because
>>> it's hard to know EXACTLY when Monticello will send it. For sure it's
>>> the first time you load that class. But then it could be if such
>>> method changes again. But maybe too if you clear some Monticello
>>> caches...
>>> Also, you may have dependencies (of order execution) with other class
>>> side initialize.  So...another approaches you can take (depending on
>>> your needs) is lazy class var getters with ifNil:   or  if you have a
>>> ConfigurationOfYourApp, you can define #postLoadDoIts in which you can
>>> perform the whole initialization of your app. Or ...from the
>>> #postLoadDoIts simply delegate to a class MyAppInitialize.
>>>
>>> I do a bit of all of them hahaha.
>>>
>>> Cheers,
>>>
>>> On Mon, Dec 7, 2015 at 9:11 PM, Dimitris Chloupis
>>> mailto:kilon.al...@gmail.com>> wrote:
>>>
>>> ok that means  I cannot rely on it and I will have to initialize
>>> my class variables in specific methods. No problem, ifNil here I
>>> come :)
>>>
>>> On Tue, Dec 8, 2015 at 12:24 AM Sven Van Caekenberghe
>>> mailto:s...@stfx.eu>> wrote:
>>>
>>> Hi Dimitris,
>>>
>>> > On 07 Dec 2015, at 23:12, Dimitris Chloupis
>>> mailto:kilon.al...@gmail.com>> wrote:
>>> >
>>> > I have read that a metaclass (class side of the class) is
>>> initialised when its loaded to the image by monticello, Are
>>> there any other cases when the initialize method of the the
>>> metaclass is being called ?
>>>
>>> Correct: a class #initialize is called when its code is
>>> loaded, but only if it is not yet present or different in
>>> source code from what is already present (this last point will
>>> bite you one day ;-).
>>>
>>> Else, the #initialize should be called manually (for example
>>> to reload some caches, or reset some system state). This
>>> sometimes happens in #postLoads or install scripts.
>>>
>>> I am not aware of any automatic invocations.
>>>
>>> Sven
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com 
>>>
>>
>>
>
>


-- 
Mariano
http://marianopeck.wordpress.com


Re: [Pharo-users] When a metaclass is initialised by the system ?

2015-12-08 Thread Thierry Goubier

Le 08/12/2015 16:53, Christophe Demarey a écrit :

yes, we miss a package initialize method ...


FileTree, GitFileTree and probably Monticello have support for a package 
initialize method.


Now, when I was doing my browser, I wondered about giving access to such 
code... turns out nobody uses it.


Thierry



Le 8 déc. 2015 à 16:35, Mariano Martinez Peck a écrit :


Dimitris,

Relying in class side initialize is not very cool. Mostly, because
it's hard to know EXACTLY when Monticello will send it. For sure it's
the first time you load that class. But then it could be if such
method changes again. But maybe too if you clear some Monticello caches...
Also, you may have dependencies (of order execution) with other class
side initialize.  So...another approaches you can take (depending on
your needs) is lazy class var getters with ifNil:   or  if you have a
ConfigurationOfYourApp, you can define #postLoadDoIts in which you can
perform the whole initialization of your app. Or ...from the
#postLoadDoIts simply delegate to a class MyAppInitialize.

I do a bit of all of them hahaha.

Cheers,

On Mon, Dec 7, 2015 at 9:11 PM, Dimitris Chloupis
mailto:kilon.al...@gmail.com>> wrote:

ok that means  I cannot rely on it and I will have to initialize
my class variables in specific methods. No problem, ifNil here I
come :)

On Tue, Dec 8, 2015 at 12:24 AM Sven Van Caekenberghe
mailto:s...@stfx.eu>> wrote:

Hi Dimitris,

> On 07 Dec 2015, at 23:12, Dimitris Chloupis
mailto:kilon.al...@gmail.com>> wrote:
>
> I have read that a metaclass (class side of the class) is
initialised when its loaded to the image by monticello, Are
there any other cases when the initialize method of the the
metaclass is being called ?

Correct: a class #initialize is called when its code is
loaded, but only if it is not yet present or different in
source code from what is already present (this last point will
bite you one day ;-).

Else, the #initialize should be called manually (for example
to reload some caches, or reset some system state). This
sometimes happens in #postLoads or install scripts.

I am not aware of any automatic invocations.

Sven







--
Mariano
http://marianopeck.wordpress.com 







Re: [Pharo-users] When a metaclass is initialised by the system ?

2015-12-08 Thread Dimitris Chloupis
What about slots ? Do they have any special initialiazation ?

On Tue, 8 Dec 2015 at 17:54, Christophe Demarey 
wrote:

> yes, we miss a package initialize method ...
>
> Le 8 déc. 2015 à 16:35, Mariano Martinez Peck a écrit :
>
> Dimitris,
>
> Relying in class side initialize is not very cool. Mostly, because it's
> hard to know EXACTLY when Monticello will send it. For sure it's the first
> time you load that class. But then it could be if such method changes
> again. But maybe too if you clear some Monticello caches...
> Also, you may have dependencies (of order execution) with other class side
> initialize.  So...another approaches you can take (depending on your needs)
> is lazy class var getters with ifNil:   or  if you have a
> ConfigurationOfYourApp, you can define #postLoadDoIts in which you can
> perform the whole initialization of your app. Or ...from the #postLoadDoIts
> simply delegate to a class MyAppInitialize.
>
> I do a bit of all of them hahaha.
>
> Cheers,
>
> On Mon, Dec 7, 2015 at 9:11 PM, Dimitris Chloupis 
> wrote:
>
>> ok that means  I cannot rely on it and I will have to initialize my class
>> variables in specific methods. No problem, ifNil here I come :)
>>
>> On Tue, Dec 8, 2015 at 12:24 AM Sven Van Caekenberghe 
>> wrote:
>>
>>> Hi Dimitris,
>>>
>>> > On 07 Dec 2015, at 23:12, Dimitris Chloupis 
>>> wrote:
>>> >
>>> > I have read that a metaclass (class side of the class) is initialised
>>> when its loaded to the image by monticello, Are there any other cases when
>>> the initialize method of the the metaclass is being called ?
>>>
>>> Correct: a class #initialize is called when its code is loaded, but only
>>> if it is not yet present or different in source code from what is already
>>> present (this last point will bite you one day ;-).
>>>
>>> Else, the #initialize should be called manually (for example to reload
>>> some caches, or reset some system state). This sometimes happens in
>>> #postLoads or install scripts.
>>>
>>> I am not aware of any automatic invocations.
>>>
>>> Sven
>>>
>>>
>>>
>>>
>>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>


Re: [Pharo-users] When a metaclass is initialised by the system ?

2015-12-08 Thread Christophe Demarey
yes, we miss a package initialize method ...

Le 8 déc. 2015 à 16:35, Mariano Martinez Peck a écrit :

> Dimitris,
> 
> Relying in class side initialize is not very cool. Mostly, because it's hard 
> to know EXACTLY when Monticello will send it. For sure it's the first time 
> you load that class. But then it could be if such method changes again. But 
> maybe too if you clear some Monticello caches...
> Also, you may have dependencies (of order execution) with other class side 
> initialize.  So...another approaches you can take (depending on your needs) 
> is lazy class var getters with ifNil:   or  if you have a 
> ConfigurationOfYourApp, you can define #postLoadDoIts in which you can 
> perform the whole initialization of your app. Or ...from the #postLoadDoIts 
> simply delegate to a class MyAppInitialize.
> 
> I do a bit of all of them hahaha.
> 
> Cheers,
> 
> On Mon, Dec 7, 2015 at 9:11 PM, Dimitris Chloupis  
> wrote:
> ok that means  I cannot rely on it and I will have to initialize my class 
> variables in specific methods. No problem, ifNil here I come :) 
> 
> On Tue, Dec 8, 2015 at 12:24 AM Sven Van Caekenberghe  wrote:
> Hi Dimitris,
> 
> > On 07 Dec 2015, at 23:12, Dimitris Chloupis  wrote:
> >
> > I have read that a metaclass (class side of the class) is initialised when 
> > its loaded to the image by monticello, Are there any other cases when the 
> > initialize method of the the metaclass is being called ?
> 
> Correct: a class #initialize is called when its code is loaded, but only if 
> it is not yet present or different in source code from what is already 
> present (this last point will bite you one day ;-).
> 
> Else, the #initialize should be called manually (for example to reload some 
> caches, or reset some system state). This sometimes happens in #postLoads or 
> install scripts.
> 
> I am not aware of any automatic invocations.
> 
> Sven
> 
> 
> 
> 
> 
> 
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com



smime.p7s
Description: S/MIME cryptographic signature


Re: [Pharo-users] When a metaclass is initialised by the system ?

2015-12-08 Thread Mariano Martinez Peck
Dimitris,

Relying in class side initialize is not very cool. Mostly, because it's
hard to know EXACTLY when Monticello will send it. For sure it's the first
time you load that class. But then it could be if such method changes
again. But maybe too if you clear some Monticello caches...
Also, you may have dependencies (of order execution) with other class side
initialize.  So...another approaches you can take (depending on your needs)
is lazy class var getters with ifNil:   or  if you have a
ConfigurationOfYourApp, you can define #postLoadDoIts in which you can
perform the whole initialization of your app. Or ...from the #postLoadDoIts
simply delegate to a class MyAppInitialize.

I do a bit of all of them hahaha.

Cheers,

On Mon, Dec 7, 2015 at 9:11 PM, Dimitris Chloupis 
wrote:

> ok that means  I cannot rely on it and I will have to initialize my class
> variables in specific methods. No problem, ifNil here I come :)
>
> On Tue, Dec 8, 2015 at 12:24 AM Sven Van Caekenberghe 
> wrote:
>
>> Hi Dimitris,
>>
>> > On 07 Dec 2015, at 23:12, Dimitris Chloupis 
>> wrote:
>> >
>> > I have read that a metaclass (class side of the class) is initialised
>> when its loaded to the image by monticello, Are there any other cases when
>> the initialize method of the the metaclass is being called ?
>>
>> Correct: a class #initialize is called when its code is loaded, but only
>> if it is not yet present or different in source code from what is already
>> present (this last point will bite you one day ;-).
>>
>> Else, the #initialize should be called manually (for example to reload
>> some caches, or reset some system state). This sometimes happens in
>> #postLoads or install scripts.
>>
>> I am not aware of any automatic invocations.
>>
>> Sven
>>
>>
>>
>>
>>


-- 
Mariano
http://marianopeck.wordpress.com


Re: [Pharo-users] When a metaclass is initialised by the system ?

2015-12-07 Thread Dimitris Chloupis
ok that means  I cannot rely on it and I will have to initialize my class
variables in specific methods. No problem, ifNil here I come :)

On Tue, Dec 8, 2015 at 12:24 AM Sven Van Caekenberghe  wrote:

> Hi Dimitris,
>
> > On 07 Dec 2015, at 23:12, Dimitris Chloupis 
> wrote:
> >
> > I have read that a metaclass (class side of the class) is initialised
> when its loaded to the image by monticello, Are there any other cases when
> the initialize method of the the metaclass is being called ?
>
> Correct: a class #initialize is called when its code is loaded, but only
> if it is not yet present or different in source code from what is already
> present (this last point will bite you one day ;-).
>
> Else, the #initialize should be called manually (for example to reload
> some caches, or reset some system state). This sometimes happens in
> #postLoads or install scripts.
>
> I am not aware of any automatic invocations.
>
> Sven
>
>
>
>
>


Re: [Pharo-users] When a metaclass is initialised by the system ?

2015-12-07 Thread Sven Van Caekenberghe
Hi Dimitris,

> On 07 Dec 2015, at 23:12, Dimitris Chloupis  wrote:
> 
> I have read that a metaclass (class side of the class) is initialised when 
> its loaded to the image by monticello, Are there any other cases when the 
> initialize method of the the metaclass is being called ? 

Correct: a class #initialize is called when its code is loaded, but only if it 
is not yet present or different in source code from what is already present 
(this last point will bite you one day ;-).

Else, the #initialize should be called manually (for example to reload some 
caches, or reset some system state). This sometimes happens in #postLoads or 
install scripts.

I am not aware of any automatic invocations.

Sven