Created
August 8, 2010 19:55
-
-
Save vito/514462 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val ensuring: p do: b := { | |
res = b call: [val] | |
p call: [val] | |
res | |
} call | |
with-output-to: (fn: String) do: b := | |
Port (new: fn) ensuring: @close do: { file | | |
with-input-from: file do: b | |
} | |
with-output-to: (p: Port) do: b := { | |
current-output-port = p | |
join: b | |
} call | |
with-input-from: (fn: String) do: b := | |
Port (new: fn) ensuring: @close do: { file | | |
with-input-from: file do: b | |
} | |
with-input-from: (p: Port) do: b := { | |
current-input-port = p | |
join: b | |
} call |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment