* working on librarifying syntax.ss

This commit is contained in:
Abdulaziz Ghuloum 2007-04-30 04:51:37 -04:00
parent 2fe1943872
commit bee4776036
6 changed files with 1987 additions and 1575 deletions

Binary file not shown.

View File

@ -1293,6 +1293,7 @@
(make-bind lhs* rhs* (mk-mvcall body c))] (make-bind lhs* rhs* (mk-mvcall body c))]
[else (error 'mk-mvcall "invalid producer ~s" (unparse p))])) [else (error 'mk-mvcall "invalid producer ~s" (unparse p))]))
(define (copy-propagate x) (define (copy-propagate x)
(define who 'copy-propagate) (define who 'copy-propagate)
(define the-void (make-primcall 'void '())) (define the-void (make-primcall 'void '()))
@ -5293,6 +5294,16 @@
(lambda (x) (lambda (x)
((current-eval) x))) ((current-eval) x)))
(primitive-set! 'compile-time-core-eval
(make-parameter
(lambda (x)
(parameterize ([current-expand (lambda (x) x)])
(compile-expr x)))
(lambda (f)
(unless (procedure? f)
(error 'compile-time-core-eval "~s is not a procedure" f))
f)))
) )

View File

@ -88,6 +88,8 @@
string->number exact->inexact string->number exact->inexact
flonum? flonum->string string->flonum flonum? flonum->string string->flonum
sin cos atan sqrt sin cos atan sqrt
chi-top-library
compile-time-core-eval
)) ))
(define (system-primitives) (define (system-primitives)
@ -231,7 +233,10 @@
(load script) (load script)
(exit 0)] (exit 0)]
[else [else
(printf "Ikarus Scheme (Build ~a)\n" "NO TIME STRING") (let ()
(define-syntax compile-time-string
(lambda (x) (date-string)))
(printf "Ikarus Scheme (Build ~a)\n" (compile-time-string)))
;(printf "Ikarus Scheme (Build ~a)\n" (compile-time-date-string)) ;(printf "Ikarus Scheme (Build ~a)\n" (compile-time-date-string))
(display "Copyright (c) 2006-2007 Abdulaziz Ghuloum\n\n") (display "Copyright (c) 2006-2007 Abdulaziz Ghuloum\n\n")
(command-line-arguments args) (command-line-arguments args)

View File

@ -100,6 +100,8 @@
flonum? flonum->string string->flonum flonum? flonum->string string->flonum
sin cos atan sqrt sin cos atan sqrt
chi-top-library compile-time-core-eval
)) ))
(define system-primitives (define system-primitives
@ -228,7 +230,7 @@
(whack-system-env #t) (whack-system-env #t)
(define scheme-library-files (define scheme-library-files
'( ["libhandlers.ss" "libhandlers.fasl" p0 onepass] '(["libhandlers.ss" "libhandlers.fasl" p0 onepass]
["libcontrol.ss" "libcontrol.fasl" p0 onepass] ["libcontrol.ss" "libcontrol.fasl" p0 onepass]
["libcollect.ss" "libcollect.fasl" p0 onepass] ["libcollect.ss" "libcollect.fasl" p0 onepass]
["librecord.ss" "librecord.fasl" p0 onepass] ["librecord.ss" "librecord.fasl" p0 onepass]

View File

@ -586,6 +586,10 @@
(lambda (x) (lambda (x)
(eval `(,noexpand ,x)))) (eval `(,noexpand ,x))))
(define compile-time-eval-hook
(lambda (x)
(eval `(,noexpand ,x))))
(define define-top-level-value-hook (define define-top-level-value-hook
(lambda (sym val) (lambda (sym val)
(top-level-eval-hook (top-level-eval-hook
@ -2050,9 +2054,11 @@
(else (error 'sc-expand-internal "unexpected module binding type ~s" t))))) (else (error 'sc-expand-internal "unexpected module binding type ~s" t)))))
(loop bs)))))))))))) (loop bs))))))))))))
(define chi-top-library
(include "syntax.ss") (let ()
(include "syntax.ss")
(primitive-set! 'chi-top-library library-expander)
library-expander))
(define id-set-diff (define id-set-diff
(lambda (exports defs) (lambda (exports defs)
@ -3079,6 +3085,7 @@
)) ))
;;; core transformers ;;; core transformers
(global-extend 'local-syntax 'letrec-syntax #t) (global-extend 'local-syntax 'letrec-syntax #t)

File diff suppressed because it is too large Load Diff