Here is a reimplementation of "cat" in it:
#!/usr/bin/env imp
(def copy-out (proc (x)
(let f (if (file? x) x (open x))
bytes (read default-chunk f)
(if bytes
(seq (write bytes stdout)
(recur f))
(close f)))))
(if (nil? script-args)
(copy-out stdin)
(each copy-out script-args))
Running external programs is a bit more verbose than normal shell, but there is some optional reader-macro sugar on top of fork+exec, e.g. the effect of the following is that /usr/bin/say gets run with those non-string args converted to strings and a voice comes out of my speaker. !(say hello there)
=> ((status : 0) (pid : 2945) (in : [File]) (out : [File]) (err : [File]))