home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / LISP / PDLISP.ZIP / BAKQUOTE.L next >
Encoding:
Text File  |  1986-03-31  |  936 b   |  32 lines

  1. ; bakquote.l - backquote macro definition
  2. ; copyright (c) 1985, 1986 by David Morein.
  3. ;
  4. ; revision history:
  5. ; rewritten by D. Morein 4/1/86 to cure depth related problems.
  6. ; modified by Art Goldhammer 2/13/86 to work at lower levels in a list.
  7. ; created by D. Morein 11/28/84
  8. ;
  9. ; note - this is an initialization file, see the manual for more info.
  10. ;
  11. ; set up system hooks:
  12. ;
  13. (status /sys/const/back_quote_hook '_backquote)
  14. (status /sys/const/comma_hook      '_comma)
  15. (status /sys/const/comma_at_hook   '_comma-at)
  16. ;
  17. (def _backquote (nlambda (s)
  18.     (backquote1 s)))
  19. ;
  20. (def _backquote1 (lambda (e)
  21.     (cond    ((or (atom e) (null e)) e)
  22.         ((and (consp (car e)) (eq (caar e) 'comma))
  23.             (cons
  24.                 (eval (cadar e))
  25.                 (_backquote1 (cdr e))))
  26.         ((and (consp (car e)) (eq (caar e) 'comma-at))
  27.             (append (eval (cadar e)) (_backquote1 (cdr e))))
  28.         (t    (cons
  29.                 (_backquote1 (car e))
  30.                 (_backquote1 (cdr e)))))))
  31. ;
  32.