File: init-defpackage.scm

package info (click to toggle)
scsh 0.5.1-2
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 6,540 kB
  • ctags: 8,656
  • sloc: lisp: 39,346; ansic: 13,466; sh: 1,669; makefile: 624
file content (23 lines) | stat: -rw-r--r-- 901 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
; Copyright (c) 1993, 1994 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-REFLECTIVE-TOWER-MAKER is called when
; a DEFINE-STRCTURE form is evaluated.

(define-reflective-tower-maker
  (let ((reflective-tower (*structure-ref syntactic 'reflective-tower))
	(make-simple-interface (*structure-ref interfaces 'make-simple-interface))
	(env (interaction-environment)))
    (lambda (clauses id)
      (if (null? clauses)
	  ;; (make-reflective-tower eval (list scheme) id)
	  (reflective-tower (package->environment env))
	  (delay (let ((p (eval `(a-package ((for-syntax ,id)) ,@clauses)
				env)))
		   (ensure-loaded (make-structure p
						  (lambda () (make-simple-interface #f '()))
						  'for-syntax))
		   (cons eval p)))))))