Skip to content

Instantly share code, notes, and snippets.

@jkominek
Created April 20, 2015 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkominek/636c496e56ce8cda517c to your computer and use it in GitHub Desktop.
Save jkominek/636c496e56ce8cda517c to your computer and use it in GitHub Desktop.
#lang racket/base
(require racket/cmdline)
(define-syntax-rule
(while<> line body ...)
(let ([process-port
(lambda ()
(for ([line (in-port read-line)])
body ...))])
(command-line #:args files
(if (empty? files)
(process-port)
(for ([f files])
(with-input-from-file f process-port))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment