; Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees. See file COPYING.


; This file has to be loaded into the initial-image before any use of
; DEFINE-STRUCTURE.  Compare with alt/init-defpackage.scm.

; The procedure given to DEFINE-SYNTACTIC-TOWER-MAKER is called when
; a DEFINE-STRUCTURE form is evaluated.

(define-syntactic-tower-maker
  (let ((compile-syntax-node (*structure-ref evaluation 'compile-syntax-node))
	(ensure-instantiated (*structure-ref load-packages 'ensure-instantiated))
	(package (interaction-environment)))
    (lambda (for-syntax-alist id)
	(vector compile-syntax-node
		(make-lookup-package-maker ensure-instantiated)
		(and for-syntax-alist
		     (map (lambda (p)
			    (cons (car p)
				  (lambda ()
				    (map (lambda (struct)
					   (eval struct package))
				    (cdr p)))))
			  for-syntax-alist))))))

(define-reader vanilla-read-forms)

