Skip to content

Instantly share code, notes, and snippets.

@adambard
Created August 16, 2012 17:59
Show Gist options
  • Save adambard/3372132 to your computer and use it in GitHub Desktop.
Save adambard/3372132 to your computer and use it in GitHub Desktop.
There is no such thing as lazy I/O
; Throws an error
(with-open [f (RandomAccessFile. "test_file.tmp", "rws")]
(map #(.writeInt f %1) (range 1000)))
; Runs happily
(with-open [f (RandomAccessFile. "test_file.tmp", "rws")]
(dorun (map #(.writeInt f %1) (range 1000))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment