source: project/release/3/misc-extn/trunk/misc-extn-io.scm @ 10987

Last change on this file since 10987 was 5437, checked in by Kon Lovett, 14 years ago

Release 3.0, where misc-extn.scm is rmvd & macros split into sep files.

File size: 672 bytes
Line 
1;;;; misc-extn-io.scm
2;;;; Kon Lovett, Mar '05
3
4(eval-when (compile)
5  (declare
6    (fixnum)
7    (inline)
8    (no-procedure-checks)
9    (no-bound-checks)
10    (export
11      cout cerr nl) ) )
12
13;;;
14
15;; Like cout << arguments << args
16;; where argument can be any Scheme object. If it's a procedure
17;; (without args) it's executed rather than printed (like newline)
18
19(define (%outarg x port)
20  (if (procedure? x) (x port) (display x port)) )
21
22(define (cout . args)
23  (for-each (cute %outarg <> (current-output-port)) args) )
24
25(define (cerr . args)
26  (for-each (cute %outarg <> (current-error-port)) args) )
27
28;; The newline character as a string
29
30(define nl (string #\newline))
Note: See TracBrowser for help on using the repository browser.