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))))))))
|
||||
|
||||
(define (print obj . port)
|
||||
(write obj (if (null? port) (current-output-port) (car port)))
|
||||
(newline)
|
||||
obj)
|
||||
|
||||
(define (print-help)
|
||||
(display "picrin scheme\n")
|
||||
(display "\n")
|
||||
|
@ -36,10 +41,6 @@
|
|||
(else
|
||||
(file->string (car args)))))))
|
||||
|
||||
(define (print obj)
|
||||
(write obj)
|
||||
(newline))
|
||||
|
||||
(define (main-loop)
|
||||
(display "> ")
|
||||
(let ((expr (read)))
|
||||
|
|
Loading…
Reference in New Issue