; MIT License
; Copyright (C) 2022 Shintaro Mukai.
; https://mukai.systems/articles/7g8qtipoaa2083lfave1mol8c0kahlir/

; head.

(function head ()
  (foreach write-line
           (take (collect read-line) 10)))

(function! main (args)
  (if (nil? args) (head)
      (dolist (arg args)
        (if (> (len args) 1) (write-line (str "==> " arg " <==")))
        (with-open ($in arg :read)
          (head)))))
