Skip to content

Instantly share code, notes, and snippets.

@vito
Created August 8, 2010 17:10
Show Gist options
  • Save vito/514272 to your computer and use it in GitHub Desktop.
Save vito/514272 to your computer and use it in GitHub Desktop.
file writing comparison: The, Scheme, Ruby
"writan to the terminal" print
with-output-to: "foo.txt" do: {
"writan to foo.txt" print
}
(display "writan to the terminal\n")
(with-output-to-file "foo.txt"
(lambda () (display "writan to foo.txt\n")))
puts "writing to the terminal"
File.open("foo.txt", "w") do |f|
f.write("writan to foo.txt\n")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment