Added missing parens... d'oh

This commit is contained in:
Justin Ethier 2015-06-23 23:02:01 -04:00
parent a1f7e3a8ee
commit b3229da15e
2 changed files with 5 additions and 5 deletions

View file

@ -21,7 +21,7 @@
(define (with-output-to-file string thunk) (define (with-output-to-file string thunk)
;; Have to do this the long way since parameterize is not available ;; Have to do this the long way since parameterize is not available
(let ((old (current-output-port)) (let ((old (current-output-port))
(new (current-output-port '<param-convert> (open-output-file string)))) (new ((current-output-port '<param-convert>) (open-output-file string))))
(dynamic-wind (dynamic-wind
(lambda () (current-output-port '<param-set!> new)) (lambda () (current-output-port '<param-set!> new))
thunk thunk

View file

@ -1,6 +1,6 @@
;(import (scheme base) (import (scheme base)
; (scheme file) (scheme file)
; (scheme write)) (scheme write))
; TODO: I think this compiles OK (test), but interpreter does not like it: ; TODO: I think this compiles OK (test), but interpreter does not like it:
;cyclone> ( call-with-output-file "test.txt" (lambda () #f)) ;cyclone> ( call-with-output-file "test.txt" (lambda () #f))
@ -32,7 +32,7 @@
(define my-param (define my-param
(my-make-parameter (current-output-port)));(Cyc-stdout))) (my-make-parameter (current-output-port)));(Cyc-stdout)))
(define old (my-param)) (define old (my-param))
(define new (my-param '<param-convert> (open-output-file "test.txt"))) (define new ((my-param '<param-convert>) (open-output-file "test.txt")))
; The next line seems to crash in icyc but not in compiled code (until write, at least). what's going on?? ; The next line seems to crash in icyc but not in compiled code (until write, at least). what's going on??
(my-param '<param-set!> new) (my-param '<param-set!> new)
(write 'test (my-param)) (write 'test (my-param))