[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Issue: FUNCTION-TYPE (Version 5)
- To: navajo!NGALL%G.BBN.COM@navajo.stanford.edu
- Subject: Issue: FUNCTION-TYPE (Version 5)
- From: edsel!kent-state!eb@navajo.stanford.edu (Eric Benson)
- Date: Tue, 23 Jun 87 09:16:28 PDT
- Cc: navajo!cl-cleanup%sail@navajo.stanford.edu
- In-reply-to: navajo!NGALL@G.BBN.COM's message of 23 Jun 1987 01:34-EDT <[G.BBN.COM]23-Jun-87 01:34:43.NGALL>
Date: 23 Jun 1987 01:34-EDT
Sender: navajo!NGALL@G.BBN.COM
From: navajo!NGALL@G.BBN.COM
My main concern about losing symbols as valid function objects (i.e.,
things that can be given to apply and funcall) is that it will make
the "functional style" of Lisp more difficult to debug.
For example, I use the following reader macro to allow function names
(symbols) to be used as arguments when my code is in the debugging
phase and "true" fucntions to be used when my code is "finished".
(defun |#!-reader| (stream subchar arg)
(declare (ignore subchar arg))
(let ((fname (read stream t nil t)))
(if *debugging-p*
`',fname
`#',fname)))
(set-dispatch-macro-character
#\#
#\!
(if *debugging-p* '|#!-reader| #'|#!-reader|))
Here's a version of your debugging environment that adheres to the
strict definition of functions:
(defun |#!-reader| (stream subchar arg)
(declare (ignore subchar arg))
(let ((fname (read stream t nil t)))
(if (consp fname)
`#',fname
(if *debugging-p*
`#'(lambda (&rest x) (apply #',fname x))
`#',fname))))
(set-dispatch-macro-character
#\#
#\!
(if *debugging-p*
#'(lambda (&rest x) (apply #'|#!-reader| x))
#'|#!-reader|))