File: init-defpackage.scm

package info (click to toggle)
scheme48 1.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 14,980 kB
  • ctags: 14,127
  • sloc: lisp: 76,272; ansic: 71,514; sh: 3,026; makefile: 637
file content (30 lines) | stat: -rw-r--r-- 1,023 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
; 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-REFLECTIVE-TOWER-MAKER is called when
; a DEFINE-STRUCTURE form is evaluated.

(define-reflective-tower-maker
  (let ((environment-macro-eval
	  (*structure-ref compiler-envs 'environment-macro-eval))
	(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)
	  (environment-macro-eval (package->environment env))
	  (delay
	    (let ((package (eval `(a-package ,(if id
						  `(for-syntax ,id)
						  '(for-syntax))
					     ,@clauses)
				 env)))
	      (ensure-loaded (make-structure package
					     (lambda ()
					       (make-simple-interface #f '()))
					     'for-syntax))
	      (cons eval package)))))))