Subject: Re: ILC2005: McCarthy denounces Common Lisp, "Lisp", XML, and Rahul
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 02 Jul 2005 03:03:09 -0500
Newsgroups: comp.lang.lisp
Message-ID: <1vadnbQcGICg11vfRVn-pw@speakeasy.net>
Marcus Breiing  <usenet@2005w20.mail.breiing.com> wrote:
+---------------
| * Rob Warnock
| > I forgot to mention that I actually prefer ML's name "FN" for a
| > LAMBDA abbreviation, since it's the same number of keystrokes as
| > "\\" but doesn't print weirdly
|   
| I use the FN name, but not the Scheme lambda lists.  It seems that
| macros really *do* fragment the language:-)
+---------------

They do, which is why I noted that I only use these abbrevs myself
directly in the REPL, and not in permanent code.

+---------------
| For another dimension of potentially divergent design, my version adds
| an IGNORABLE declaration for arguments beginning with "_":
+---------------

O.k., then, even though the OP said "no readmacros", I guess now
I have to show you my ugly #$ readmacro in all of its grossness:  ;-}

;;; SET-SHARP-DOLLAR-READER -- Experimental LAMBDA abbreviation (#1 of 2).
;;; SYNTAX: #$FORM
;;; An abbreviation of: (lambda (&optional $1 $2 $3 $4 $5 $6 $7 $8 $9 &rest $*)
;;;                       FORM)
;;; Within the FORM, args $1 ... $9 and $* are be lambda-bound as positional
;;; and &REST parameters, respectively. Usually, but not always, FORM will be
;;; an S-expr, e.g. #$(car $3), but this is legal: #$FOO ==> (lambda () FOO),
;;; that is, (CONSTANTLY FOO). Likewise, #$$3 ==> #'THIRD.
;;;
;;; As a convenience for interactive use, in the special case that FORM is a
;;; list and (car FORM) is also a list, then an implicit PROGN is provided,
;;; e.g., #$((foo) (bar)) ==> (lambda (args...) (foo) (bar)).
;;;
(defun set-sharp-dollar-reader ()
  (flet ((sharp-dollar-reader (s c p)
           (declare (ignore c p))
           (let* ((form (read s t nil t)))
             `(lambda (&optional $1 $2 $3 $4 $5 $6 $7 $8 $9 &rest $*)
                (declare (ignorable $1 $2 $3 $4 $5 $6 $7 $8 $9 $*))
                ,@(if (and (consp form) (consp (car form)))
                    form
                    (list form))))))
    (set-dispatch-macro-character #\# #\$ #'sharp-dollar-reader)))


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607