From: jimka
Subject: why is there an initargs arument for  update-instance-for-redefined-class
Date: 
Message-ID: <e100c6b2-dc40-40ad-9eab-a7bd04290e91@w24g2000prd.googlegroups.com>
The generic function update-instance-for-redefined-class has the
following lambda list
(instance added-slots discarded-slots property-list &rest initargs
&key &allow-other-keys).
And the documentation
http://www.lispworks.com/documentation/HyperSpec/Body/f_upda_1.htm#update-instance-for-redefined-class
claims that instances of classes undergoing class-redefinition get
initialized with these initargs

> This method then initializes slots with values according to the initargs,
> and initializes the newly added-slots with values according to their :initform forms.

It also claims
> The generic function update-instance-for-redefined-class is not intended to be called by programmers.

So my question is who calls this method and supplies any initargs?
What are these initargs good for?

jim

From: Kenny
Subject: Re: why is there an initargs arument for  update-instance-for-redefined-class
Date: 
Message-ID: <48cfa5eb$0$5667$607ed4bc@cv.net>
jimka wrote:
> The generic function update-instance-for-redefined-class has the
> following lambda list
> (instance added-slots discarded-slots property-list &rest initargs
> &key &allow-other-keys).
> And the documentation
> http://www.lispworks.com/documentation/HyperSpec/Body/f_upda_1.htm#update-instance-for-redefined-class
> claims that instances of classes undergoing class-redefinition get
> initialized with these initargs
> 
> 
>>This method then initializes slots with values according to the initargs,
>>and initializes the newly added-slots with values according to their :initform forms.
> 
> 
> It also claims
> 
>>The generic function update-instance-for-redefined-class is not intended to be called by programmers.
> 
> 
> So my question is who calls this method and supplies any initargs?

I think you missed the second sentence where the first question is 
answered explicitly. :)

The update is called by CLOS internals when an instance first gets 
accessed following a defclass evaluation changing the class of the instance.

kt
From: jimka
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <10da10fc-49ea-40ba-8249-57a1a18116e1@r15g2000prd.googlegroups.com>
No, I saw that sentence and indeed have read it many times.  But I
still do not see who calls
update-instance-for-redefined-class and supplies any initargs.
From: Kenny
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <48cf6933$0$4870$607ed4bc@cv.net>
jimka wrote:
> No, I saw that sentence and indeed have read it many times.  But I
> still do not see who calls
> update-instance-for-redefined-class and supplies any initargs.

Delightful. I also answered your question in /my/ second sentence. I am 
afraid to write another sentence. That one didn't count. Or that one. 
They don't count all the way down.

hth, kzo
From: jimka
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <820dd46d-6d93-4a62-8f7a-8c5428daae17@q5g2000prf.googlegroups.com>
hi kenny, no, in this case you gave a very good answer, but it was an
answer
to a question I did not ask.

My question was not, "Who calls update-instance-for-redefined-class?"
which
is the question you answered, and did so very well by the way.


>
> Delightful. I also answered your question in /my/ second sentence. I am
> afraid to write another sentence. That one didn't count. Or that one.
> They don't count all the way down.
>
> hth, kzo
From: Kenny
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <48cf9018$0$4870$607ed4bc@cv.net>
jimka first wrote:
 > [The CLHS] also claims
 >
 >>> The generic function update-instance-for-redefined-class is not 
intended to be called by programmers.
 >
 > So my question is who calls this method and supplies any initargs?

jimka then wrote:
> hi kenny, no, in this case you gave a very good answer, but it was an
> answer to a question I did not ask.
> 
> My question was not, "Who calls update-instance-for-redefined-class?"

This is wonderful! it will keep me cheerful all week.

best, kenneth
From: Kenny
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <48cfeb0e$0$4972$607ed4bc@cv.net>
jimka wrote:
> No, I saw that sentence and indeed have read it many times.  But I
> still do not see who calls
> update-instance-for-redefined-class 

Ah, here is another place you did not not ask that question. :)

...
and supplies any initargs.

I guess you also did not read ("yes I did!") clhs 4.3.6.2

hth, kxo
From: Rainer Joswig
Subject: Re: why is there an initargs arument for  update-instance-for-redefined-class
Date: 
Message-ID: <joswig-39C973.15155216092008@news-europe.giganews.com>
In article 
<····································@w24g2000prd.googlegroups.com>,
 jimka <·····@rdrop.com> wrote:

> The generic function update-instance-for-redefined-class has the
> following lambda list
> (instance added-slots discarded-slots property-list &rest initargs
> &key &allow-other-keys).
> And the documentation
> http://www.lispworks.com/documentation/HyperSpec/Body/f_upda_1.htm#update-instance-for-redefined-class
> claims that instances of classes undergoing class-redefinition get
> initialized with these initargs
> 
> > This method then initializes slots with values according to the initargs,
> > and initializes the newly added-slots with values according to their :initform forms.
> 
> It also claims
> > The generic function update-instance-for-redefined-class is not intended to be called by programmers.
> 
> So my question is who calls this method and supplies any initargs?
> What are these initargs good for?
> 
> jim

You redefine a class with some changed slots -> wait a bit -> access an instance of that class ->
Lisp calls the function with the instance to update it for the redefined class.
Initargs? They are usually coming from DEFCLASS.

  or:

you call MAKE-INSTANCES-OBSOLETE with a class as argument.

-- 
http://lispm.dyndns.org/
From: jimka
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <a45d1da0-9a7d-4d36-bb0d-9779255f3d1c@25g2000prz.googlegroups.com>
No, I do not think the initargs come from the DEFCLASS.  Normally
initargs come from a make-instance
or a change-class.

It looks to me like all the function initialize-instance, reinitialize-
instance, update-instance-for-redefined-class, and update-instance-for-
different-class
have this initargs argument.  It makes sense for all of these cases
except
update-instance-for-redefined-class.

I understand how initialize-instance, reinitialize-instance, and
update-instance-for-different-class
will get called with init args, because they are often triggered by a
make-instance
or change classes in which case initargs may be specified.

But there does not seem to be any way that I can see where update-
instance-for-redefined-class
can have a non-nil initargs.

Am I wrong?  Can someone provide an example where update-instance-for-
different-class is
called with a non-nil initargs?

-jim
From: Rainer Joswig
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <joswig-E4CA05.16514116092008@news-europe.giganews.com>
In article 
<····································@25g2000prz.googlegroups.com>,
 jimka <·····@rdrop.com> wrote:

> No, I do not think the initargs come from the DEFCLASS.  Normally
> initargs come from a make-instance
> or a change-class.
> 
> It looks to me like all the function initialize-instance, reinitialize-
> instance, update-instance-for-redefined-class, and update-instance-for-
> different-class
> have this initargs argument.  It makes sense for all of these cases
> except
> update-instance-for-redefined-class.
> 
> I understand how initialize-instance, reinitialize-instance, and
> update-instance-for-different-class
> will get called with init args, because they are often triggered by a
> make-instance
> or change classes in which case initargs may be specified.
> 
> But there does not seem to be any way that I can see where update-
> instance-for-redefined-class
> can have a non-nil initargs.
> 
> Am I wrong?  Can someone provide an example where update-instance-for-
> different-class is
> called with a non-nil initargs?
> 
> -jim

The idea is that you have an :around method and it
calls CALL-NEXT-METHOD with the initargs.

-- 
http://lispm.dyndns.org/
From: John Thingstad
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <op.uhksqmt7ut4oq5@pandora.alfanett.no>
P� Tue, 16 Sep 2008 13:43:29 +0200, skrev jimka <·····@rdrop.com>:

> The generic function update-instance-for-redefined-class has the
> following lambda list
> (instance added-slots discarded-slots property-list &rest initargs
> &key &allow-other-keys).
> And the documentation
> http://www.lispworks.com/documentation/HyperSpec/Body/f_upda_1.htm#update-instance-for-redefined-class
> claims that instances of classes undergoing class-redefinition get
> initialized with these initargs
>
>> This method then initializes slots with values according to the  
>> initargs,
>> and initializes the newly added-slots with values according to their  
>> :initform forms.
>
> It also claims
>> The generic function update-instance-for-redefined-class is not  
>> intended to be called by programmers.
>
> So my question is who calls this method and supplies any initargs?
> What are these initargs good for?
>
> jim

Read the CLOS MOP. http://www.lisp.org/mop/concepts.html The book 'art of  
meta object protocol' (AMOP) is better at explaining the underlying  
concepts. The key concept is that MOP is itself written in CLOS and is a  
metacircular protocol. In order to allow the system to be extesible some  
functions can be extended, and are documented as such, and some are there  
to implement the protocol and messing with them will break CLOS. The  
problem with MOP is you kinda have to see how it all fits together, so it  
is easier to just get and read the book.

--------------
John Thingstad
From: jimka
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <12500bd7-1c82-4b0d-9f04-29e192592323@i20g2000prf.googlegroups.com>
As far as the MOP is concerned, having the initargs available would
allow
methods on subclasses of standard-object to call update-instance-for-
redefined-class
with a non-nil initargs.  An example would be enlightening.

However, it seems that as far as standard-object is concerned, the
initargs
is useless on update-instance-for-redefined-class.

-jim
From: Rainer Joswig
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <joswig-6B621C.18073716092008@news-europe.giganews.com>
In article 
<····································@i20g2000prf.googlegroups.com>,
 jimka <·····@rdrop.com> wrote:

> As far as the MOP is concerned, having the initargs available would
> allow
> methods on subclasses of standard-object to call update-instance-for-
> redefined-class
> with a non-nil initargs.  An example would be enlightening.
> 
> However, it seems that as far as standard-object is concerned, the
> initargs
> is useless on update-instance-for-redefined-class.
> 
> -jim

You have seen my remark?

Somebody defines :

(defmethod update-instance-for-redefined-class :around ( ...)
   (call-next-method ... some-initargs ...))


The generic function will be called by the system updating
instances on class redefinition.
The :around method runs and supplies the initargs.

So:

* the user usually does not call this function
* the system calls it on redefition without initargs
* the around method is a way to introduce the initargs

-- 
http://lispm.dyndns.org/
From: Kenny
Subject: Re: why is there an initargs arument for update-instance-for-redefined-class
Date: 
Message-ID: <48cff646$0$4901$607ed4bc@cv.net>
jimka wrote:
> As far as the MOP is concerned, having the initargs available would
> allow
> methods on subclasses of standard-object to call update-instance-for-
> redefined-class
> with a non-nil initargs.  An example would be enlightening.

Then for the love of God do not read 4.3.6.2 where they tell you when it 
is not called which is when you and I were thinking it was and when it 
is called which is when the instance is a class and not an application 
instance in which case it does not get called with initargs.

Parse that, win a car.

This meta thing always makes me have to lie down and close my eyes and I 
think I just got to an enlightening example of that.

hth, kzo
From: Pascal Costanza
Subject: Re: why is there an initargs arument for  update-instance-for-redefined-class
Date: 
Message-ID: <6jat23F2boqfU1@mid.individual.net>
jimka wrote:
> The generic function update-instance-for-redefined-class has the
> following lambda list
> (instance added-slots discarded-slots property-list &rest initargs
> &key &allow-other-keys).
> And the documentation
> http://www.lispworks.com/documentation/HyperSpec/Body/f_upda_1.htm#update-instance-for-redefined-class
> claims that instances of classes undergoing class-redefinition get
> initialized with these initargs
> 
>> This method then initializes slots with values according to the initargs,
>> and initializes the newly added-slots with values according to their :initform forms.
> 
> It also claims
>> The generic function update-instance-for-redefined-class is not intended to be called by programmers.
> 
> So my question is who calls this method and supplies any initargs?
> What are these initargs good for?

Per ANSI Common Lisp, the CLOS implementation calls 
update-instance-for-redefined-class and does _not_ pass any initargs 
here. See Sections 4.3.6.2 and 4.3.6.3 in the HyperSpec.

I can only speculate, but my guess is that the designers assumed that 
other metaclass may have a use for calling that function with initargs.


Pascal

-- 
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
From: Kenny
Subject: Re: why is there an initargs arument for  update-instance-for-redefined-class
Date: 
Message-ID: <48d00871$0$4908$607ed4bc@cv.net>
Pascal Costanza wrote:
> jimka wrote:
> 
>> The generic function update-instance-for-redefined-class has the
>> following lambda list
>> (instance added-slots discarded-slots property-list &rest initargs
>> &key &allow-other-keys).
>> And the documentation
>> http://www.lispworks.com/documentation/HyperSpec/Body/f_upda_1.htm#update-instance-for-redefined-class 
>>
>> claims that instances of classes undergoing class-redefinition get
>> initialized with these initargs
>>
>>> This method then initializes slots with values according to the 
>>> initargs,
>>> and initializes the newly added-slots with values according to their 
>>> :initform forms.
>>
>>
>> It also claims
>>
>>> The generic function update-instance-for-redefined-class is not 
>>> intended to be called by programmers.
>>
>>
>> So my question is who calls this method and supplies any initargs?
>> What are these initargs good for?
> 
> 
> Per ANSI Common Lisp, the CLOS implementation calls 
> update-instance-for-redefined-class and does _not_ pass any initargs 
> here. See Sections 4.3.6.2 and 4.3.6.3 in the HyperSpec.

He has read those. Uselss.

> 
> I can only speculate, but my guess is that the designers assumed that 
> other metaclass may have a use for calling that function with initargs.

He has already spoken to them, they had nothing to offer. Except that 
they can see Russia from their houses. We're still working on what that 
last one means.*

hth, kenny

* Name the movie, win a beer. Add the actor and you can skip the buy 
back. kt