From: Kelly Murray
Subject: Backquote syntax {}
Date: 
Message-ID: <371BE87F.5E8C02EB@IntelliMarket.Com>
Just thought I'd post the ACL code to implement
the NiCLOS backquote syntax.
A further idea is to replace `(zap {(zip 1 2)} with just
`(zap {zip 1 2}) but this would be confused with a 
function call of no args, e.g. `(zap {zip}) which
can be fixed by requiring the full paren form in this case:
`(zap {(zip)}).  I haven't implemented this idea.

-Kelly Murray  ยทยทยท@niclos.com

The code below does the simple case, which makes the reader return
the same form as using , and ,@ so in fact, it
will print the form back using , and ,@ and not {} and {}*

(defun curl-reader-macro (stream char)
  (declare (ignore char))
  (when (<= excl::*backquote-count* 0)
    (excl::internal-reader-error stream "{ not inside a backquote."))
  (let* ((excl::*backquote-count* (1- excl::*backquote-count*))
	 (form (read stream t nil t)))
   (case (peek-char nil stream t nil t)
     (#\} (read-char stream t nil t)
	  (case (peek-char nil stream t nil t)
	    (#\*
	     (read-char stream t nil t)
	     (list 'excl::bq-comma-atsign form))
	    (t (list 'excl::bq-comma form))))
     (t
      (list 'excl::bq-comma form)))))

(set-macro-character #\{ 'curl-reader-macro nil)