chiark / gitweb /
Remove `SOD_CAR' from the public interface.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 29 Dec 2015 23:00:33 +0000 (23:00 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 10 May 2016 09:25:54 +0000 (10:25 +0100)
It's now called `SOD__CAR', no longer documented, and in a new, clearly
marked `preliminaries utilities' section of the header file.  This new
section precedes the header-file inclusions because they can in
principle depend on the definitions made here.

This macro probably won't change, but I reserve the right to make the
internal utilities be weird in ways which won't break the way Sod uses
them, but might break other things which rely on them.

doc/runtime.tex
lib/sod.3
lib/sod.h
src/class-output.lisp

index 487bcee14548d23c107958676c394fa7cf6ccf79..6f5c6be5888c0cd75044dc42187dfd89e662368a 100644 (file)
@@ -87,17 +87,6 @@ general use.
   @|SOD_INSTBASE| macro (described below) is more suited to general use.
 \end{describe}
 
-\begin{describe}[SOD_CAR]{mac} {@<arg> SOD_CAR(@<arg>, @<other-arg>^*);}
-  Accepts one or more arguments and expands to just its first argument,
-  discarding the others.
-
-  It is only defined if the C implementation advertises support for C99.  It
-  is used in the definitions of message convenience macros for messages which
-  accept a variable number of arguments but no required arguments, and is
-  exported because the author has found such a thing useful in other
-  contexts.
-\end{describe}
-
 %%%--------------------------------------------------------------------------
 \section{Utility macros} \label{sec:runtime.utility}
 
index a1d520ae4b519a478964f3b33aef4dfc98d4e582..e5f9096bfb04d10c3b8d6c8bd5a9accde414cc18 100644 (file)
--- a/lib/sod.3
+++ b/lib/sod.3
@@ -68,10 +68,6 @@ sod \- Sensible Object Design runtime library
 .IB cls ,
 .IB chead ,
 .BI "const void *" obj );
-.br
-.B SOD_CAR(\c
-.IB arg ,
-.RB ... );
 .PP
 .B const void *\c
 .B SOD_CLASSOF(\c
@@ -205,19 +201,6 @@ about the dynamic type of an instance.
 The
 .B SOD_INSTBASE
 macro (described below) is more suited to general use.
-.PP
-The
-.B SOD_CAR
-macro accepts one or more arguments
-and expands to just its first argument,
-discarding the others.
-It is only defined if the C implementation
-advertises support for C99.
-It is used in the definitions of message convenience macros
-for messages which accept a variable number of arguments
-but no required arguments,
-and is exported because the author has found such a thing useful in
-other contexts.
 .
 .SS Utility macros
 The following macros are expected to be useful
index 074989d96d2dc6938cbea1d325d0f74a3705ad04..dc85843d4fee58c1fa1f629749f80ae61e232f63 100644 (file)
--- a/lib/sod.h
+++ b/lib/sod.h
   extern "C" {
 #endif
 
+/*----- Preliminary utilities ---------------------------------------------*/
+
+/* --- @SOD__CAR@ --- *
+ *
+ * Arguments:  @...@ = a nonempty list of arguments
+ *
+ * Returns:    The first argument only.
+ */
+
+#if __STDC_VERSION__ >= 199901
+#  define SOD__CAR(...) SOD__CARx(__VA_LIST__, _)
+#  define SOD__CARx(a, ...) a
+#endif
+
 /*----- Header files ------------------------------------------------------*/
 
 #include <stdarg.h>
@@ -125,18 +139,6 @@ struct sod_chain {
   ((struct cls##__ilayout *)                                           \
    ((char *)(obj) - offsetof(struct cls##__ilayout, chead)))
 
-/* --- @SOD_CAR@ --- *
- *
- * Arguments:  @...@ = a nonempty list of arguments
- *
- * Returns:    The first argument only.
- */
-
-#if __STDC_VERSION__ >= 199901
-#  define SOD_CAR(...) SOD__CARx(__VA_LIST__, _)
-#  define SOD__CARx(a, ...) a
-#endif
-
 /*----- Utility macros ----------------------------------------------------*/
 
 /* --- @SOD_CLASSOF@ --- *
index aea85d4bd3d821b470d58d4a21af772943965d67..f47bc7e251fa690b16c7ebcd05b25ee8a28649e9 100644 (file)
@@ -168,7 +168,7 @@ (defmethod hook-output progn ((class sod-class) (reason (eql :h)) sequencer)
                                raw-name)))
                 (cond ((and (cdr args) (eq (cadr args) :ellipsis))
                        (setf varargsp t)
-                       (unless in-names (setf me "SOD_CAR(__VA_ARGS__)"))
+                       (unless in-names (setf me "SOD__CAR(__VA_ARGS__)"))
                        (push (format nil "/*~A*/ ..." name) in-names)
                        (push "__VA_ARGS__" out-names)
                        (return))