starting to work on resources
This commit is contained in:
parent
2d695d700a
commit
bc8369b25c
|
@ -1,5 +1,10 @@
|
||||||
#lang s-exp "kernel.rkt"
|
#lang s-exp "kernel.rkt"
|
||||||
(provide (all-from-out "kernel.rkt")
|
|
||||||
#;(all-from-out "private/list.rkt"))
|
(provide (except-out (all-from-out "kernel.rkt")
|
||||||
|
)
|
||||||
|
;;(all-from-out "private/list.rkt")
|
||||||
|
)
|
||||||
|
|
||||||
(require racket/private/modbeg
|
(require racket/private/modbeg
|
||||||
#;"private/list.rkt")
|
;"private/list.rkt"
|
||||||
|
)
|
|
@ -61,7 +61,7 @@
|
||||||
e
|
e
|
||||||
null
|
null
|
||||||
#%plain-module-begin
|
#%plain-module-begin
|
||||||
#%module-begin
|
(rename-out [my-module-begin #%module-begin])
|
||||||
#%datum
|
#%datum
|
||||||
#%app
|
#%app
|
||||||
#%top-interaction
|
#%top-interaction
|
||||||
|
@ -69,6 +69,7 @@
|
||||||
module
|
module
|
||||||
define
|
define
|
||||||
define-values
|
define-values
|
||||||
|
let-syntax
|
||||||
let-values
|
let-values
|
||||||
let*-values
|
let*-values
|
||||||
define-struct
|
define-struct
|
||||||
|
@ -434,3 +435,20 @@ symbol->string
|
||||||
|
|
||||||
(define (set-cdr! x v)
|
(define (set-cdr! x v)
|
||||||
(error 'set-car! "Not available outside JavaScript context."))
|
(error 'set-car! "Not available outside JavaScript context."))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
(define-syntax (my-module-begin stx)
|
||||||
|
(syntax-case stx ()
|
||||||
|
[(_ body ...)
|
||||||
|
(with-syntax ([(expanded-body ...)
|
||||||
|
(local-expand #'(body ...)
|
||||||
|
'module-begin
|
||||||
|
#f)])
|
||||||
|
(syntax/loc stx
|
||||||
|
(#%module-begin expanded-body ...)))]))
|
|
@ -11,12 +11,19 @@
|
||||||
|
|
||||||
;; file-resource:
|
;; file-resource:
|
||||||
;;
|
;;
|
||||||
(define-for-syntax (file-resource stx)
|
(define-syntax (file-resource stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ path)
|
[(_ path)
|
||||||
(syntax/loc stx
|
(let ([dontcare
|
||||||
(let-syntax ([compile-time-code
|
(syntax-local-lift-expression #'(begin
|
||||||
(lambda (stx)
|
(begin-for-syntax
|
||||||
(displayln "at compile time")
|
(printf "Compile time code executing"))
|
||||||
#'(void))])
|
(void)))])
|
||||||
(resource path)))]))
|
(syntax/loc stx
|
||||||
|
(let-syntax ([compile-time-code
|
||||||
|
(lambda (stx)
|
||||||
|
(printf "compile time code executing\n")
|
||||||
|
#'(void))])
|
||||||
|
(begin
|
||||||
|
;;dontcare
|
||||||
|
(resource path)))))]))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user