CMUCL commit: RELEASE-20B-BRANCH src/code (extfmts.lisp)
Raymond Toy
rtoy at common-lisp.net
Mon Sep 6 17:35:29 CEST 2010
Date: Monday, September 6, 2010 @ 11:35:29
Author: rtoy
Path: /project/cmucl/cvsroot/src/code
Tag: RELEASE-20B-BRANCH
Modified: extfmts.lisp
code/extfmts.lisp
o Add some comments from Paul Foley on what arguments to DEF-EF-MACRO
mean.
--------------+
extfmts.lisp | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
Index: src/code/extfmts.lisp
diff -u src/code/extfmts.lisp:1.35.4.5 src/code/extfmts.lisp:1.35.4.6
--- src/code/extfmts.lisp:1.35.4.5 Sun Sep 5 21:01:27 2010
+++ src/code/extfmts.lisp Mon Sep 6 11:35:28 2010
@@ -5,7 +5,7 @@
;;; domain.
;;;
(ext:file-comment
- "$Header: /project/cmucl/cvsroot/src/code/extfmts.lisp,v 1.35.4.5 2010-09-06 01:01:27 rtoy Exp $")
+ "$Header: /project/cmucl/cvsroot/src/code/extfmts.lisp,v 1.35.4.6 2010-09-06 15:35:28 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
@@ -697,7 +697,27 @@
;;; DEF-EF-MACRO -- Public
;;;
-;;;
+;;; Create an ef-macro (external-format macro). This creates a
+;;; function named Name that will process an external format in the
+;;; desired way.
+;;;
+;;; Paul Foley says:
+;;; All the existing ef-macros are provided with the implementation,
+;;; so they all use lisp::lisp as the id; it's intended for people
+;;; who want to write their own macros~there are some number of
+;;; slots (+ef-max+) used by the implementation; the idea is that
+;;; you can write something like (def-ef-macro foo (ef my-tag 4 1)
+;;; ...) to implement 1 of a total of 4 new macros in your own
+;;; "namespace", without having to know how many are implemented by
+;;; others (e.g., the 10 used by the base implementation...which
+;;; could change with the next release -- and if several libraries
+;;; each add their own, the total number, and the position of each
+;;; one's slots within that total, may change depending on load
+;;; order, etc.) When you write the above, it allocates 4 new
+;;; places and associates the base index with "my-tag", then the
+;;; "idx" value is relative to that base. The id lisp:lisp always
+;;; has its base at 0, so it doesn't need to go through ensure-cache
+;;; to find that out.
(defmacro def-ef-macro (name (ef id reqd idx) body)
(let* ((tmp1 (gensym))
(tmp2 (gensym))
More information about the cmucl-commit
mailing list