print takes an optional argument for output port, and returns obj itself
This commit is contained in:
parent
f09a27cd0a
commit
96f8a969e0
|
@ -14,6 +14,11 @@
|
||||||
""
|
""
|
||||||
(string-append line (loop (read-line))))))))
|
(string-append line (loop (read-line))))))))
|
||||||
|
|
||||||
|
(define (print obj . port)
|
||||||
|
(write obj (if (null? port) (current-output-port) (car port)))
|
||||||
|
(newline)
|
||||||
|
obj)
|
||||||
|
|
||||||
(define (print-help)
|
(define (print-help)
|
||||||
(display "picrin scheme\n")
|
(display "picrin scheme\n")
|
||||||
(display "\n")
|
(display "\n")
|
||||||
|
@ -36,10 +41,6 @@
|
||||||
(else
|
(else
|
||||||
(file->string (car args)))))))
|
(file->string (car args)))))))
|
||||||
|
|
||||||
(define (print obj)
|
|
||||||
(write obj)
|
|
||||||
(newline))
|
|
||||||
|
|
||||||
(define (main-loop)
|
(define (main-loop)
|
||||||
(display "> ")
|
(display "> ")
|
||||||
(let ((expr (read)))
|
(let ((expr (read)))
|
||||||
|
|
Loading…
Reference in New Issue