Skip to content

Instantly share code, notes, and snippets.

@yamasushi
Last active April 6, 2018 08:13
Show Gist options
  • Save yamasushi/4e39c4d5cc3016b469aa to your computer and use it in GitHub Desktop.
Save yamasushi/4e39c4d5cc3016b469aa to your computer and use it in GitHub Desktop.
#!/usr/bin/env gosh
;https://gist.github.com/yamasushi/4e39c4d5cc3016b469aa
(use gauche.lazy)
(use gauche.parseopt)
(define (main args) (let-args (cdr args)
((nchr "n=i" 140) . files )
($ print
$ list->string
$ (cut ltake <> nchr)
(if (null? files)
($ port->char-lseq $ standard-input-port)
($ lconcatenate $ lmap ($ port->char-lseq $ open-input-file $) files)
) )
) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment