Sam Steingold <ยทยทยท@goems.com> writes:
> while trying to implement an EL/CL compatibility package (a preliminary
> version is available in elisp.lsp in
> <http://www.goems.com/~sds/data/cllib.zip>), I encountered a problem:
> apparently, the following (calendar.el in Emacs distribution):
>
> (defmacro calendar-for-loop (var from init to final do &rest body)
> "Execute a for loop."
> (` (let (( (, var) (1- (, init)) ))
> (while (>= (, final) (setq (, var) (1+ (, var))))
> (,@ body)))))
>
> is correct in EL (but not in CL). obviously I have to redefine
> backquote in the emacs-lisp package, but I don't know how to do this
> easily (I am not particularly eager to re-invent the wheel).
>
> Any suggestions?
>
> [the obvious solution - load backquote.el - fails because the file
> defines `backquote-unquote-symbol' to be ', and the reader chokes on
> this]
>
> Thanks.
In the olden days (maclisp), pre-backquote, we used to do:
(sublis (list (cons 'var var) (cons 'init init) (cons 'final final)
(cons 'bodyform (cons 'progn body)))
'(let ((var (1- init)))
(while (>= final (setq var (1+ var))) bodyform)))
Don't know if that helps, but it's worth noticing that sometimes when
technology runs awry, the underlying thing they're buying you sometimes
isn't worth the fuss.