Newsgroups: comp.lang.clos
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!news
From: barmar@think.com (Barry Margolin)
Subject: Can SLOT-VALUE be used on structures?
Message-ID: <1991Apr11.223022.24056@Think.COM>
Sender: news@Think.COM
Organization: Thinking Machines Corporation, Cambridge MA, USA
Date: Thu, 11 Apr 91 22:30:22 GMT

As those of you who read other comp.lang.lisp or various Lisp-related
mailing lists know, I'm compiling a frequently-asked question list for
Lisp.  I'm in the process of trying to write an answer to the question "how
can I access structure slots given the slot name as a parameter?"  One
possible answer seems to be to use SLOT-VALUE, but I'm not sure how
portable this is.  I can't find any place in X3J13/88-002R or CLtL2 that
specifically says that this is allowed.  X3J13/88-003 (the original
Meta-Object Protocol draft) defines SLOT-VALUE-USING-CLASS on
STRUCTURE-CLASS, so a CLOS implementation that conforms to that should
allow it.

I tried the two CLOS implementations I have access to; Genera 8.0 supports
SLOT-VALUE on structures, but Lucid 4.0 doesn't.  So I certainly can't
answer that all CLOS implementation provide this capability.  However, if
the forthcoming MOP spec includes this requirement, I'd like to include it
as a possibility in the FAQ answer.
--
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar
