about summary refs log tree commit diff stats
path: root/chicken-scratch.scm
blob: 307aa8dc121d72b7bf62f8eb0d3c91a52a8f1a1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#| -*- scheme -*-
exec csi -ss "$0" "$@"
CHICKEN-SCRATCH: here-doc templating for CHICKEN scheme
(C) Case Duckworth <acdw@acdw.net>
License: BSD-3.  See COPYING for details.
|#

(import chicken-scratch
        (chicken file)
        (chicken process-context))

(define (main args)
  ;; XXX: handle standard input piping
  ;; XXX: Must have an #(import chicken-scratch at the beginning)
  (for-each (lambda (file)
              (when (file-exists? file)
                (display (with-input-from-file file expand-port))
                (newline)))
            args))

(main (command-line-arguments))