[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Making the KCL compiler recursive
- To: commonloops.PA@Xerox.COM
- Subject: Making the KCL compiler recursive
- From: harrisr@turing.cs.rpi.edu (Richard Harris)
- Date: Thu, 18 Aug 88 14:03:59 EDT
- Redistributed: commonloops.PA
Here is a way to make the KCL compiler recursive. It should work for both
KCL and AKCL. To make this message shorter, the comments beginning with
";***" give instructions that you will need to follow.
Rick Harris
;Beginning of patches.
(in-package "COMPILER")
(defvar *cmpvar-list* nil)
(defmacro defcmpvar (name form)
`(eval-when (compile load eval)
(defvar ,name ,form)
(addcmpvar ',name ',form)))
(defun addcmpvar (name form)
(let ((a (assoc name *cmpvar-list*)))
(if a
(setf (cadr a) form)
(push (list name form) *cmpvar-list*)))
name)
(defmacro in-compiler (&body forms)
`(progv
(mapcar #'car *cmpvar-list*)
(mapcar #'(lambda (v-f) (eval (cadr v-f))) *cmpvar-list*)
,@forms))
;*** For each setq in init-env (found in cmpnew/cmpenv.lsp),
;*** put a defcmpvar form here.
;*** (for example, init-env contains "(setq *next-cvar* 0)",
;*** so put "(defcmpvar *next-cvar* 0)" here)
;*** Extract the definitions of compile-file1, compile1, and disassemble1
;*** (found in cmpnew/cmpmain.lsp), and put them here.
;*** For each function:
;*** 1) The first (or maybe second) form begins "(cond (*compiler-in-use*".
;*** Remove this form.
;*** 2) Replace the first occurrence of "(init-env)" with "(in-compiler",
;*** and the second occurrence of "(init-env)" with ")".
;End of patches.