Copy stdin to stdout: Difference between revisions
→{{header|Binary Lambda Calculus}}
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
|||
(6 intermediate revisions by 4 users not shown) | |||
Line 94:
=={{header|Brainf***}}==
<syntaxhighlight lang="brainf***">,[.,]</syntaxhighlight>
=={{header|Binary Lambda Calculus}}==
As explained on https://www.ioccc.org/2012/tromp/hint.html, `cat' is the 4-bit program
<pre>0010</pre>
in bit-wise BLC, or any one of the 16 characters in the ASCII range from space to slash
<pre> !"#$%&'()*+,-./</pre>
in byte-wise BLC.
=={{header|C}}==
Line 371 ⟶ 383:
}
}</syntaxhighlight>
===io.Copy===
<syntaxhighlight lang="go">
package main
import (
"io"
"os"
)
func main() {
io.Copy(os.Stdout, os.Stdin)
}
</syntaxhighlight>
=={{header|Groovy}}==
Line 611 ⟶ 637:
</pre>
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">
$stdout << $stdin.gets
</syntaxhighlight>
=={{header|Rust}}==
<syntaxhighlight lang="rust">use std::io;
Line 703 ⟶ 733:
Bytes are read from stdin and written to stdout until the return key is pressed.
<syntaxhighlight lang="
Stdin.isRaw = true // prevents echoing to the terminal
|