I am reviving the old LISP program from the early 1980s. (This is a Nelson-Oppen simplification, an early proof system. This version was part of the Ford Pascal-F Verifier and worked at Franz LISP in 1982.) Here's the whole program:
https://github.com/John-Nagle/pasv/tree/master/src/CPC4
I am converting code for working under CLISIS on Linux and need some advice. Most problems are related to macros. That is the question today.
DEFSMAC and DEFMAC
Older Stanford AI Lab macros to simplify the definition of a macro before defmacro became part of the language. Macros and their documentation are here:
https://github.com/John-Nagle/pasv/blob/master/src/CPC4/defmac.l
These are macros that generate more macros.
;;; defmac (define macro) and defsmac (define simple macro) are like defun,
;;; but they define the function as a macro instead of as an expr. They are
;;; less powerful then defining a macro directly (for example, they cannot be
;;; used to define macros with arbitrarily many arguments) but are easier to
;;; use. For example,
;;;
;;; (defsmac f (x y) (foo (bar x) (bar y)))
;;;
;;; causes f to be defined as a macro in such a way that every call (f e1 e2)
;;; will expand to (foo (bar e1) (bar e2)) before it is evaluated.
(defun defsmac macro (args)
(defsmac1 (cadr args) (caddr args) (cdddr args)))
(defun defsmac1 (name formals body)
`(defun ,name macro (app)
,(defsmac2 formals
(cond ((cdr body) (cons 'progn body))
(t (car body))))))
(defun defsmac2 (formals body)
`(sublis ,(defsmac3 formals 1) (quote ,body)))
(defun defsmac3 (formals n)
(cond ((null formals) nil)
(`(cons (cons (quote ,(car formals)) (car ,(defsmac4 n)))
,(defsmac3 (cdr formals) (1+ n))))))
(defun defsmac4 (n) (cond ((= n 0) 'app) ((list 'cdr (defsmac4 (1- n))))))
"defmacro" . , "defun with macro". . 46
http://www.softwarepreservation.org/projects/LISP/franz/Franz_Lisp_July_1983.pdf
. , . , , , , "" , . .
, , , . Common LISP , ?
Franz LISP/MacLISP Common LISP. ?