[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Keyword problem in PCL
- To: commonloops.pa@Xerox.COM
- Subject: Keyword problem in PCL
- From: <krall%pp.mcc.com%pp.mcc.com@mcc.com (Ed Krall)>
- Date: Fri, 15 May 87 08:20 CDT
- Posted-date: Friday, 15 May 1987, 08:20-CDT
- Sender: krall%pp.mcc.com@mcc.com
Perhaps I am missing something, but the following behavior is a bit of a
problem:
Class AAA has an instance variable or slot called "name". Therefore
subclass AA of AAA also has this slot. When I do a
(make-instance 'AA :name "joe"),
the slot that gets initialized is the one named pcl::name not user::name.
Why is this? Because
1. the keyword lookup procedure (referenced from
initialize-from-init-plist in the file slots.lsp) does a simple
forward search on the value returned by class-instance-slots, and
2. this value lists the instance slots in ancestral order, and
3. the slots pcl::name and user::name have the same keyword, :name.
I wonder if this is the optimal behavior. Shouldn't the more recent or
local declaration (user::name) shadow the older and more general one
(pcl::name)?