just checking it in
svn: r4426
This commit is contained in:
parent
02d9fbd35c
commit
fc7322a4b3
|
@ -43,13 +43,15 @@
|
|||
|
||||
;; --------------------------------------------------------------------------
|
||||
;; Delay/force etc
|
||||
|
||||
|
||||
(provide ~)
|
||||
(defsubst (~ x) (delay x))
|
||||
|
||||
(define (! x) (if (promise? x) (! (force x)) x))
|
||||
;; the exposed `!' must be a special form
|
||||
(provide (rename special-form-! !))
|
||||
;; hack to see if it solves a certificate problem:
|
||||
(provide (rename ! crazythingthatwillneverbereferredto))
|
||||
(defsubst (special-form-! x) (! x) special-form-! !)
|
||||
|
||||
;; These things are useful too, to write strict functions (with various
|
||||
|
@ -256,18 +258,26 @@
|
|||
;; `!apply': provided as `apply' (no need to provide `~!apply', since all
|
||||
;; function calls are delayed by `#%app')
|
||||
|
||||
(define-syntax (jbc! stx)
|
||||
(syntax-case stx (!)
|
||||
[(_ arg) (syntax-property #`(! arg) 'stepper-skipto '(syntax-e cdr syntax-e cdr car))]))
|
||||
|
||||
(define-syntax (!*app stx)
|
||||
(syntax-case stx (~ ! !! !list !!list !values !!values)
|
||||
[(_ f x ...)
|
||||
(let ([$$ (lambda (stx) (syntax-property stx 'stepper-skipto '(syntax-e cdr cdr both-l () (car))))]
|
||||
[$ (lambda (stx) (syntax-property stx 'stepper-skipto '(syntax-e cdr syntax-e car)))])
|
||||
(with-syntax ([(y ...) (generate-temporaries #'(x ...))])
|
||||
(with-syntax ([(!y ...) (map (lambda (stx) (syntax-property stx 'stepper-skipto '(syntax-e cdr syntax-e cdr car)))
|
||||
(syntax->list #`((! y) ...)))])
|
||||
;; use syntax/loc for better errors etc
|
||||
(with-syntax ([lazy (syntax/loc stx (p y ...))]
|
||||
[strict (syntax/loc stx (p (! y) ...))])
|
||||
(syntax/loc stx
|
||||
(let ([p f] [y x] ...)
|
||||
(if (lazy? p) lazy strict)))))]))
|
||||
(with-syntax ([lazy (quasisyntax/loc stx (p y ...))]
|
||||
[strict (quasisyntax/loc stx (p !y ...))])
|
||||
(quasisyntax/loc stx
|
||||
(let ([p f] [y x] ...)
|
||||
#,($$ #`(if (lazy? p) lazy strict))))))))]))
|
||||
|
||||
(defsubst (!app f x ...) (!*app (! f) x ...))
|
||||
(defsubst (!app f x ...) (!*app (jbc! f) x ...))
|
||||
(defsubst (~!*app f x ...) (~ (!*app f x ...)))
|
||||
(defsubst (~!app f x ...) (~ (!app f x ...)))
|
||||
|
||||
|
@ -768,8 +778,10 @@
|
|||
;; --------------------------------------------------------------------------
|
||||
;; Initialize special evaluation hooks
|
||||
|
||||
(let ([prim-eval (current-eval)])
|
||||
(current-eval (lambda (expr) (!! (prim-eval expr)))))
|
||||
;; taking this out so that stepper test cases will work correctly:
|
||||
|
||||
#;(let ([prim-eval (current-eval)])
|
||||
(current-eval (lambda (expr) (!! (prim-eval expr)))))
|
||||
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user