Skip to content
Snippets Groups Projects
Commit aa238b62 authored by rtoy's avatar rtoy
Browse files

code/extfmts.lisp

o Add some comments from Paul Foley on what arguments to DEF-EF-MACRO
  mean.
parent 6b9c5442
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
;;; domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/extfmts.lisp,v 1.35.4.5 2010/09/06 01:01:27 rtoy Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/extfmts.lisp,v 1.35.4.6 2010/09/06 15:35:28 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -697,7 +697,27 @@ character and illegal outputs are replaced by a question mark.")
;;; 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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment