The following message is a courtesy copy of an article
that has been posted to comp.emacs.xemacs as well.
REQUEST:
Someone mentioned that one of the problems with the (X)Emacs Lisp
reader is that you can't do reader macros (as far as I know).
Specifically, there was mention of how elisp doesnt' recognize this to
be a vector:
#(1 2 3 4 5)
I think, first of all, that this should be interpreted as such. Even
more so, I think that reader macros should be allowed in elisp, such
that something like this would work:
(defmacro defdelim (left right param-list &body body)
"Define a new LISP delimiter!"
`(ddfn ,left ,right #'(lambda ,param-list ,@body)))
(let ((rpar (get-macro-character #\))))
(defun ddfn (left right fn)
(set-macro-character right rpar)
(set-macro-character left
#'(lambda (stream char1 char2)
(declare (ignore char1 char2))
(apply fn
(read-delimited-list right stream t))))))
(defdelim #\[ #\] (&rest args)
`(vector ,@args))
i.e. the functions `set-macro-character' and other reader functions
should be included. What do people think? This would be excellent
because then XEmacs would be an even better editor--it could more
easily be made to ``read'' various formats of files.
dave
Show replies by date