mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 09:17:35 +02:00
Hack of dynamic-wind
This commit is contained in:
parent
2d664f1e06
commit
f94ddd9da9
1 changed files with 12 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
call-with-current-continuation
|
call-with-current-continuation
|
||||||
call/cc
|
call/cc
|
||||||
call-with-values
|
call-with-values
|
||||||
|
dynamic-wind
|
||||||
values
|
values
|
||||||
;(Cyc-bin-op cmp x lst)
|
;(Cyc-bin-op cmp x lst)
|
||||||
;(Cyc-bin-op-char cmp c cs)
|
;(Cyc-bin-op-char cmp c cs)
|
||||||
|
@ -63,9 +64,20 @@
|
||||||
(define *Cyc-version-banner* *version-banner*)
|
(define *Cyc-version-banner* *version-banner*)
|
||||||
;; TODO: The whitespace characters are space, tab, line feed, form feed (not in parser yet), and carriage return.
|
;; TODO: The whitespace characters are space, tab, line feed, form feed (not in parser yet), and carriage return.
|
||||||
(define call-with-current-continuation call/cc)
|
(define call-with-current-continuation call/cc)
|
||||||
|
;; TODO: this is from r7rs, but is not really good enough by itself
|
||||||
(define (values . things)
|
(define (values . things)
|
||||||
(call/cc
|
(call/cc
|
||||||
(lambda (cont) (apply cont things))))
|
(lambda (cont) (apply cont things))))
|
||||||
|
;; TODO: just need something good enough for bootstrapping (for now)
|
||||||
|
;; does not have to be perfect (this is not, does not handle call/cc or exceptions)
|
||||||
|
(define (dynamic-wind before thunk after)
|
||||||
|
(before)
|
||||||
|
(call-with-values
|
||||||
|
thunk
|
||||||
|
(lambda (result) ;results
|
||||||
|
(after)
|
||||||
|
result)))
|
||||||
|
;(apply values results))))
|
||||||
(define (Cyc-bin-op cmp x lst)
|
(define (Cyc-bin-op cmp x lst)
|
||||||
(cond
|
(cond
|
||||||
((null? lst) #t)
|
((null? lst) #t)
|
||||||
|
|
Loading…
Add table
Reference in a new issue