144 lines
8.1 KiB
HTML
144 lines
8.1 KiB
HTML
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>CLHS: Issue DEFINE-CONDITION-SYNTAX Writeup</TITLE>
|
|
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
|
|
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
|
|
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
|
|
<LINK REL=TOP HREF="../Front/index.htm">
|
|
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
|
|
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
|
|
<LINK REL=PREV HREF="../Issues/iss101_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss102.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss103_w.htm">
|
|
</HEAD>
|
|
<BODY>
|
|
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="../Issues/iss101_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss102.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss103_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue DEFINE-CONDITION-SYNTAX Writeup</H2>
|
|
|
|
<PRE><B>Issue:</B> <A HREF="iss102.htm">DEFINE-CONDITION-SYNTAX</A><P>
|
|
<B>Forum:</B> Cleanup<P>
|
|
<B>References:</B> Condition System, Version 18<P>
|
|
CLOS Specification, 88-002R<P>
|
|
Issue <A HREF="iss049.htm">CLOS-CONDITIONS</A><P>
|
|
Issue <A HREF="iss074.htm">CONDITION-ACCESSORS-SETFABLE</A><P>
|
|
<B>Category:</B> CHANGE/CLARIFICATION<P>
|
|
<B>Edit History:</B> Version 1, 1/3/90 by Kim A. Barrett<P>
|
|
<P>
|
|
<B>Problem Description:<P>
|
|
</B> Issue <A HREF="iss049.htm">CLOS-CONDITIONS</A> incompatibly changed the slot specification syntax<P>
|
|
for <A REL=DEFINITION HREF="../Body/m_defi_5.htm#define-condition"><B>DEFINE-CONDITION</B></A> to match the slot specification syntax for <A REL=DEFINITION HREF="../Body/m_defcla.htm#defclass"><B>DEFCLASS</B></A>.<P>
|
|
This leaves us with two defining macros whose general forms are very<P>
|
|
similar but which have small idiosyncratic differences.<P>
|
|
<P>
|
|
<B>Notes on voting:<P>
|
|
</B> Vote for just 1 of MORE-LIKE-DEFCLASS, INCOMPATIBLY-MORE-LIKE-DEFCLASS, or<P>
|
|
MORE-LIKE-DEFINE-CONDITION.<P>
|
|
In addition, vote yes or no to EMPHASIZE-READ-ONLY.<P>
|
|
<P>
|
|
<B>Proposal (DEFINE-CONDITION-SYNTAX:MORE-LIKE-DEFCLASS):<P>
|
|
</B> Define the syntax for <A REL=DEFINITION HREF="../Body/m_defi_5.htm#define-condition"><B>DEFINE-CONDITION</B></A> to be<P>
|
|
<P>
|
|
<A REL=DEFINITION HREF="../Body/m_defi_5.htm#define-condition"><B>DEFINE-CONDITION</B></A> name ({supertype}*) [({slot}*) {option}*]<P>
|
|
<P>
|
|
option ::= (:DEFAULT-INITARGS initarg-list) |<P>
|
|
(:DOCUMENTATION string) |<P>
|
|
(:REPORT exp)<P>
|
|
<P>
|
|
The :default-initarg option is defined in the same way as for <A REL=DEFINITION HREF="../Body/m_defcla.htm#defclass"><B>DEFCLASS</B></A>. The<P>
|
|
:documentation and :report options are unchanged.<P>
|
|
<P>
|
|
If no supertypes are specified, then the condition being defined inherits<P>
|
|
directly from <A REL=DEFINITION HREF="../Body/e_cnd.htm#condition"><B>CONDITION</B></A>.<P>
|
|
<P>
|
|
<B>Proposal (DEFINE-CONDITION-SYNTAX:INCOMPATIBLY-MORE-LIKE-DEFCLASS):<P>
|
|
</B> As DEFINE-CONDITION-SYNTAX:MORE-LIKE-DEFCLASS, but make the slot<P>
|
|
specification list required.<P>
|
|
<P>
|
|
<B>Proposal (DEFINE-CONDITION-SYNTAX:MORE-LIKE-DEFINE-CONDITION):<P>
|
|
</B> As DEFINE-CONDITION-SYNTAX:MORE-LIKE-DEFCLASS, but change the syntax of<P>
|
|
<A REL=DEFINITION HREF="../Body/m_defcla.htm#defclass"><B>DEFCLASS</B></A> so that the slot specification list is optional.<P>
|
|
<P>
|
|
Proposal (DEFINE-CONDITION-SYNTAX:EMPHASIZE-READ-ONLY)<P>
|
|
As either of the above proposals, but remove the :WRITER and :ACCESSOR<P>
|
|
slot options.<P>
|
|
<P>
|
|
<B>Rational:<P>
|
|
</B> This provides the added functionality provided by :DEFAULT-INITARGS, and<P>
|
|
the convenience of not having to explicitly write <A REL=DEFINITION HREF="../Body/e_cnd.htm#condition"><B>CONDITION</B></A> as the only<P>
|
|
super for some conditions.<P>
|
|
<P>
|
|
INCOMPATIBLY-MORE-LIKE-DEFCLASS makes the basic syntax identical, but at<P>
|
|
the cost of an incompatible change, since the list of slot specifications<P>
|
|
will no longer be optional.<P>
|
|
<P>
|
|
EMPHASIZE-READ-ONLY emphasizes the point that it is an error to attempt<P>
|
|
to assign a condition's slots using <A REL=DEFINITION HREF="../Body/a_setf.htm#setf"><B>SETF</B></A>. Condition objects are supposed<P>
|
|
to be at least conceptually read-only.<P>
|
|
<P>
|
|
<B>Current Practice:<P>
|
|
</B> IIM supports the :DEFAULT-INITARGS option. They may support the behavior<P>
|
|
specified for an empty supertype list (if they don't, then they still<P>
|
|
<A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>require</B></A> at least one supertype).<P>
|
|
<P>
|
|
<B>Cost to Implementors:<P>
|
|
</B> Supporting an empty supertype list in the specified way is probably fairly<P>
|
|
trivial. For an implementation of conditions which is not based on an<P>
|
|
implementation of CLOS, adding the support for :default-initargs might not<P>
|
|
be trivial.<P>
|
|
<P>
|
|
<B>Cost to Users:<P>
|
|
</B> MORE-LIKE-DEFCLASS is upwardly compatible for the status quo.<P>
|
|
<P>
|
|
The other two proposals will probably <A REL=DEFINITION HREF="../Body/f_provid.htm#require"><B>require</B></A> some programs to be modified.<P>
|
|
As an interim solution implementations could support MORE-LIKE-DEFCLASS and<P>
|
|
issue warnings for cases which were incompatible with the other two<P>
|
|
proposals.<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B> Programmers would need to remember fewer idiosyncratic differences in the<P>
|
|
syntax of two very similar and important macros.<P>
|
|
<P>
|
|
<B>Discussion:<P>
|
|
</B> Barrett supports MORE-LIKE-DEFINE-CONDITION. He thinks that <P>
|
|
EMPHASIZE-READ-ONLY would be a good idea if there isn't too much concern<P>
|
|
about the incompatibility issues.<P>
|
|
<P>
|
|
Pitman supports MORE-LIKE-DEFCLASS but mostly because the CLOS crew are<P>
|
|
a stubborn bunch and it seems more likely that we can bend the rest of the<P>
|
|
spec to be like their polished piece of prose than vice versa. <P>
|
|
(i.e., MORE-LIKE-DEFINE-CONDITION is technically just as good to him.)<P>
|
|
Pitman also supports EMPHASIZE-READ-ONLY.<P>
|
|
<P>
|
|
-----<P>
|
|
Additional comments in response to write-up:<P>
|
|
<P>
|
|
Moon (11 Jan 90):<P>
|
|
<P>
|
|
This issue raises good points that I think were overlooked in past<P>
|
|
discussions of unifying Conditions and CLOS.<P>
|
|
<P>
|
|
I am neutral among MORE-LIKE-DEFCLASS, INCOMPATIBLY-MORE-LIKE-DEFCLASS,<P>
|
|
or MORE-LIKE-DEFINE-CONDITION. The incompatibilities here (either making<P>
|
|
the slot-specifier list optional where it's mandatory or mandatory where<P>
|
|
it is optional) are of little concern since the adjustment is tiny. Any<P>
|
|
one of these would be a significant improvement over the status quo.<P>
|
|
<P>
|
|
I am definitely in favor of EMPHASIZE-READ-ONLY and not impressed by the<P>
|
|
compatibility arguments. An existing program that is incompatible with<P>
|
|
this either actually modifies condition objects, in which case it can't<P>
|
|
work, or it just accidentally says :ACCESSOR but only uses the reader,<P>
|
|
in which case it is trivial to fix.<P>
|
|
</PRE>
|
|
<HR>
|
|
|
|
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
|
|
|
|
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
|
|
</BODY>
|
|
</HTML>
|