about summary refs log blame commit diff stats
path: root/chibi/print.sld
blob: d3af299b1effc32284f19ce4440d5dd46c43f939 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword *
(define-library (print)
  (import (scheme base)
          (scheme write))

  (export print
          println
          prints
          printsln)
  (begin
    ;; Print arguments.
    (define (print . args)
      (for-each display args))

    ;; Print arguments, space separated.
    (define (prints . args)
      (for-each (lambda (s)
                  (display s)
                  (display " ")) args))

    ;; Print arguments and a newline.
    (define (println . args)
      (apply print args)
      (newline))

    ;; Print arguments, space separated, newline.
    (define (printsln . args)
      (apply prints args)
      (newline))))