This is a multi-part message in MIME format.
--------------3002407EE273AE454255E7B1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello and Happy New Year!
Please clarify me the following point.
Suppose I've defined the class foo with (x :accessor x).
This implicitly defines two methods with args ((f foo))
(Am I right ?). Now I can't redefine method x with different
number of args. Is this applicable to any method definition ?
In which way I could "forget" the results of previous definition ?
Thanks
--
Vladimir Zolotych ······@eurocom.od.ua
--------------3002407EE273AE454255E7B1
Content-Type: text/x-vcard; charset=us-ascii;
name="gsmith.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Vladimir V. Zolotych
Content-Disposition: attachment;
filename="gsmith.vcf"
begin:vcard
n:Zolotych;Valdimir V.
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
·····················@eurocom.od.ua
x-mozilla-cpt:;0
fn:Valdimir V. Zolotych
end:vcard
--------------3002407EE273AE454255E7B1--
* "Vladimir V. Zolotych" <······@eurocom.od.ua>
| Now I can't redefine method x with different number of args.
Methods in CLOS do not belong to the class, but to the generic function.
Please do not assume that you know how this works, but find a textbook
that explains it and read it carefully -- it is a confusion that results
only from skipping the important step of ascertaining that an assumption
you bring with you still holds -- it doesn't. Common Lisp is _not_ a
member of the C++-style class fan club.
| In which way I could "forget" the results of previous definition?
Redefine the generic function with defgeneric.
Your Common Lisp environment probably has a kill-definition function,
either in the development environment or in its extensions to the
language, but such functinality is not part of Common Lisp.
#:Erik
--
Performance is the last refuge of the miserable programmer.
Erik Naggum <····@naggum.net> writes:
> | In which way I could "forget" the results of previous definition?
>
> Redefine the generic function with defgeneric.
>
> Your Common Lisp environment probably has a kill-definition function,
> either in the development environment or in its extensions to the
> language, but such functinality is not part of Common Lisp.
His question is off course rather vague, but what functionality do you
have in mind that is outside ANSI CL? Both FMAKUNBOUND and REMOVE-METHOD
could be considered to answer his question.
--
Lieven Marchand <···@village.uunet.be>
Gla�r ok reifr skyli gumna hverr, unz sinn b��r bana.
>>>>> "Erik" == Erik Naggum <····@naggum.net> writes:
Erik> ...find a textbook that explains it and read it carefully...
Keene's book on CLOS was recommended to me, and there are other good
books listed on the ALU site (http://www.lisp.org/). I don't have the
ISBN handy, but the "annote" field is the LOC call number.
@Book{keene89:oopcl,
author = {Sonya E. Keene},
title = {Object-Oriented Programming in COMMON LISP: A
Programmer's Guide to CLOS},
publisher = {Addison-Wesley Publishing Company},
year = 1989,
address = {Reading, Massachusetts},
note = {COMMON LISP (Computer program language);
Object-oriented programming (Computer science)},
annote = {QA76.73.C28K44 1988}
}
--
"Die, spork user! And burn in fiery torment!" -- Handy, the Handpuppet of Doom
Vladimir V. Zolotych wrote:
> Hello and Happy New Year!
>
> Please clarify me the following point.
>
> Suppose I've defined the class foo with (x :accessor x).
> This implicitly defines two methods with args ((f foo))
> (Am I right ?).
No.
The important things are answered through the post of Erik, I only want
to add that :accessor doesn't add two methods with a lambda list of ((f
foo)):
It adds (in your example) the following:
(defmethod x ((f foo))
...)
(defmethod (setf x) ((value t) (f foo))
...)
This are two _different_ generic functions!
Regards,
Jochen Schmidt
http://www.dataheaven.de
This is a multi-part message in MIME format.
--------------24FF00F819244F76B5197EFD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Jochen Schmidt wrote:
> (defmethod (setf x) ((value t) (f foo))
> ...)
Yes, now I see that I should read about generic function
concept (as mentioned through the post of Erik).
I'm not familiar yet with something similar.
--
Vladimir Zolotych ······@eurocom.od.ua
--------------24FF00F819244F76B5197EFD
Content-Type: text/x-vcard; charset=us-ascii;
name="gsmith.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Vladimir V. Zolotych
Content-Disposition: attachment;
filename="gsmith.vcf"
begin:vcard
n:Zolotych;Valdimir V.
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
·····················@eurocom.od.ua
x-mozilla-cpt:;0
fn:Valdimir V. Zolotych
end:vcard
--------------24FF00F819244F76B5197EFD--