Adding opt #lang and fixing a few problems
svn: r16756
This commit is contained in:
parent
523f280b53
commit
0d6da8957a
|
@ -171,7 +171,17 @@
|
||||||
|
|
||||||
(provide #%app #%top #%datum require require-for-syntax provide define)
|
(provide #%app #%top #%datum require require-for-syntax provide define)
|
||||||
(provide display) ;; for debugging
|
(provide display) ;; for debugging
|
||||||
|
|
||||||
|
#;(require frtime/frlibs/list
|
||||||
|
frtime/frlibs/etc
|
||||||
|
frtime/frlibs/math
|
||||||
|
frtime/frlibs/date)
|
||||||
|
|
||||||
|
#;(provide (all-from frtime/frlibs/list)
|
||||||
|
(all-from frtime/frlibs/etc)
|
||||||
|
(all-from frtime/frlibs/math)
|
||||||
|
(all-from frtime/frlibs/date))
|
||||||
|
|
||||||
;; this define-struct macro defines a lowered equiv for all the
|
;; this define-struct macro defines a lowered equiv for all the
|
||||||
;; accessor functions
|
;; accessor functions
|
||||||
(define-syntax (my-define-struct stx)
|
(define-syntax (my-define-struct stx)
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ FORMS ...)
|
[(_ FORMS ...)
|
||||||
(let* (;; get a list of all the symbols provided by the frtime-opt-lang module
|
(let* (;; get a list of all the symbols provided by the frtime-opt-lang module
|
||||||
[lang-symbols (all-provided-ids #'frtime/frtime-opt-lang stx)]
|
[lang-symbols (all-provided-ids #'frtime/opt/frtime-opt-lang stx)]
|
||||||
;; convert those symbols into an equiv-map by pairing up functions
|
;; convert those symbols into an equiv-map by pairing up functions
|
||||||
;; with their lowered equivalents
|
;; with their lowered equivalents
|
||||||
[lang-equiv-map (symbol-list-to-equiv-map lang-symbols)]
|
[lang-equiv-map (symbol-list-to-equiv-map lang-symbols)]
|
||||||
|
@ -122,7 +122,7 @@
|
||||||
[equiv-map-stx (equiv-map-to-stx lang-equiv-map)])
|
[equiv-map-stx (equiv-map-to-stx lang-equiv-map)])
|
||||||
#`(#%plain-module-begin
|
#`(#%plain-module-begin
|
||||||
(require-for-syntax #,(so->d->so stx #`mzscheme))
|
(require-for-syntax #,(so->d->so stx #`mzscheme))
|
||||||
(require #,(so->d->so stx #`frtime/frtime-opt-lang))
|
(require #,(so->d->so stx #`frtime/opt/frtime-opt-lang))
|
||||||
(optimize-module #,equiv-map-stx FORMS ...)))]))
|
(optimize-module #,equiv-map-stx FORMS ...)))]))
|
||||||
|
|
||||||
|
|
||||||
|
@ -192,8 +192,8 @@
|
||||||
(module-exports-id? mod-stx (make-lowered-equiv-id id-stx)))
|
(module-exports-id? mod-stx (make-lowered-equiv-id id-stx)))
|
||||||
id-stx-list)))
|
id-stx-list)))
|
||||||
|
|
||||||
(syntax-case stx (require)
|
(syntax-case stx (#%require)
|
||||||
[(_ EQUIV-MAP (require SPEC) FORMS ...)
|
[(_ EQUIV-MAP (#%require SPEC) FORMS ...)
|
||||||
;; In the code below, we must convert syntax objects to datums, and then
|
;; In the code below, we must convert syntax objects to datums, and then
|
||||||
;; back again. Otherwise the generated require statement doesn't
|
;; back again. Otherwise the generated require statement doesn't
|
||||||
;; seem to work properly (it doesn't import the correct identifiers).
|
;; seem to work properly (it doesn't import the correct identifiers).
|
||||||
|
@ -300,7 +300,7 @@
|
||||||
(optimize-module #,new-equiv-map-stx FORMS ...)))]
|
(optimize-module #,new-equiv-map-stx FORMS ...)))]
|
||||||
)]
|
)]
|
||||||
|
|
||||||
[(_ EQUIV-MAP (require SPECS ...) FORMS ...)
|
[(_ EQUIV-MAP (#%require SPECS ...) FORMS ...)
|
||||||
;; Process each require spec individually.
|
;; Process each require spec individually.
|
||||||
#`(optimize-require EQUIV-MAP (require SPECS) ... FORMS ...)]
|
#`(optimize-require EQUIV-MAP (require SPECS) ... FORMS ...)]
|
||||||
))
|
))
|
||||||
|
|
2
collects/frtime/opt/lang/reader.ss
Normal file
2
collects/frtime/opt/lang/reader.ss
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#lang s-exp syntax/module-reader
|
||||||
|
frtime/opt/frtime-opt
|
Loading…
Reference in New Issue
Block a user