mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-08 13:37:33 +02:00
Testing
This commit is contained in:
parent
606c0f4d45
commit
dd4875d141
1 changed files with 20 additions and 4 deletions
24
test2.scm
24
test2.scm
|
@ -15,10 +15,26 @@
|
|||
; (display 'world)))
|
||||
|
||||
; BEGIN test code - trying to get definition of with-output-to-file to work
|
||||
(define old (current-output-port))
|
||||
(define new (current-output-port '<param-convert> (open-output-file "test.txt")))
|
||||
(define (my-make-parameter init . o)
|
||||
(let* ((converter
|
||||
(if (pair? o) (car o) (lambda (x) x)))
|
||||
(value (converter init)))
|
||||
(lambda args
|
||||
(cond
|
||||
((null? args)
|
||||
value)
|
||||
((eq? (car args) '<param-set!>)
|
||||
(set! value (cadr args)))
|
||||
((eq? (car args) '<param-convert>)
|
||||
converter)
|
||||
(else
|
||||
(error "bad parameter syntax"))))))
|
||||
(define my-param
|
||||
(my-make-parameter (Cyc-stdout)))
|
||||
(define old (my-param))
|
||||
(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??
|
||||
(current-output-port '<param-set!> new)
|
||||
;(write 'test (current-output-port))
|
||||
(my-param '<param-set!> new)
|
||||
(write 'test (my-param))
|
||||
;(write 'hello-world)
|
||||
; END test code
|
||||
|
|
Loading…
Add table
Reference in a new issue