Stream merge: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (Thundergnat moved page Stream Merge to Stream merge: Follow normal task title capitalization policy) |
Thundergnat (talk | contribs) (Regularize non-standard header markup) |
||
Line 1,189: | Line 1,189: | ||
</pre> |
</pre> |
||
== |
=={{header|Haskell}}== |
||
There is no built-in iterator or stream type for file operations in Haskell. But several such libraries exist. |
There is no built-in iterator or stream type for file operations in Haskell. But several such libraries exist. |
||
Line 1,714: | Line 1,714: | ||
sockets). |
sockets). |
||
== |
=={{header|Python}}== |
||
Built-in function <code>open</code> opens a file for reading and returns a line-by-line iterator (stream) over the file. |
Built-in function <code>open</code> opens a file for reading and returns a line-by-line iterator (stream) over the file. |
||
Line 1,815: | Line 1,815: | ||
monkey</pre> |
monkey</pre> |
||
== |
=={{header|REXX}}== |
||
===version 1=== |
===version 1=== |
||
<lang rexx>/* REXX *************************************************************** |
<lang rexx>/* REXX *************************************************************** |
||
Line 2,133: | Line 2,133: | ||
</lang> |
</lang> |
||
== |
=={{header|UNIX Shell}}== |
||
sort --merge source1 source2 sourceN > sink |
sort --merge source1 source2 sourceN > sink |
||
== |
=={{header|zkl}}== |
||
This solution uses iterators, doesn't care where the streams orginate and only keeps the head of the stream on hand. |
This solution uses iterators, doesn't care where the streams orginate and only keeps the head of the stream on hand. |
||
<lang zkl>fcn mergeStreams(s1,s2,etc){ //-->Walker |
<lang zkl>fcn mergeStreams(s1,s2,etc){ //-->Walker |