Documented libtoplevel.ss a bit.
This commit is contained in:
parent
2a2a3ab7fb
commit
cd4eef2382
BIN
lib/ikarus.boot
BIN
lib/ikarus.boot
Binary file not shown.
|
@ -1,9 +1,16 @@
|
||||||
|
|
||||||
|
;;; this file is one big hack that initializes the whole system.
|
||||||
|
|
||||||
|
|
||||||
|
;;; first, it defines all public primitives to their primref values.
|
||||||
|
;;; (cross your fingers they're all defined in code)
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
($set-symbol-value! x (primitive-ref x)))
|
($set-symbol-value! x (primitive-ref x)))
|
||||||
(public-primitives))
|
(public-primitives))
|
||||||
|
|
||||||
|
;;; second, it hacks a |#system| module by defining all system and
|
||||||
|
;;; public primitives to be (core-primitive . name) syntaxes.
|
||||||
(let ()
|
(let ()
|
||||||
(define add-prim
|
(define add-prim
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
|
@ -13,6 +20,9 @@
|
||||||
(for-each add-prim (public-primitives))
|
(for-each add-prim (public-primitives))
|
||||||
(for-each add-prim (system-primitives)))
|
(for-each add-prim (system-primitives)))
|
||||||
|
|
||||||
|
;;; third, all macros that are defined in the compiler |#system| are
|
||||||
|
;;; added to the top-level, and those defined in the top-level are
|
||||||
|
;;; added to the |#system|.
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(cond
|
(cond
|
||||||
|
@ -28,6 +38,8 @@
|
||||||
[else (error #f "~s is not a macro" x)]))
|
[else (error #f "~s is not a macro" x)]))
|
||||||
(macros))
|
(macros))
|
||||||
|
|
||||||
|
;;; Now we hack the read #system and scheme modules by forging
|
||||||
|
;;; interfaces and putting property lists.
|
||||||
(let ([gsys (gensym "#system")] [gsch (gensym "*scheme*")])
|
(let ([gsys (gensym "#system")] [gsch (gensym "*scheme*")])
|
||||||
(define (make-stx x)
|
(define (make-stx x)
|
||||||
(vector 'syntax-object x
|
(vector 'syntax-object x
|
||||||
|
@ -54,6 +66,8 @@
|
||||||
(putprop '|#system| '*sc-expander* sysmod)
|
(putprop '|#system| '*sc-expander* sysmod)
|
||||||
(putprop 'scheme '*sc-expander* schmod))))
|
(putprop 'scheme '*sc-expander* schmod))))
|
||||||
|
|
||||||
|
|
||||||
|
;;; Finally, we're ready to evaluate the files and enter the cafe.
|
||||||
(let-values ([(files script args)
|
(let-values ([(files script args)
|
||||||
(let f ([args (command-line-arguments)])
|
(let f ([args (command-line-arguments)])
|
||||||
(cond
|
(cond
|
||||||
|
|
Loading…
Reference in New Issue