Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Copy-stdin-to-stdout/Smalltalk/copy-stdin-to-stdout.st
Normal file
13
Task/Copy-stdin-to-stdout/Smalltalk/copy-stdin-to-stdout.st
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
"using Stream class's bulk copy method:"
|
||||
Stdin copyToEndInto:Stdout.
|
||||
|
||||
"line wise"
|
||||
[Stdin atEnd] whileFalse:[ Stdout nextPutLine:(Stdin nextLine) ].
|
||||
|
||||
"character wise"
|
||||
[Stdin atEnd] whileFalse:[ Stdout nextPut:(Stdin next) ].
|
||||
|
||||
"no EOF test, but handle EOF Exception"
|
||||
[
|
||||
[ Stdout nextPut:(Stdin next) ] loop.
|
||||
] on: StreamError do:[]
|
||||
Loading…
Add table
Add a link
Reference in a new issue