Looks reasonable to me too. One very minimal stylistic point is that I
would write

for line in eachline(STDIN)
    print("Found: $line")
end


instead of using the = form of the for loop, which I really only use when
the thing that's being iterated over is an immediate range object.


On Sat, Jul 12, 2014 at 4:57 PM, Leah Hanson <[email protected]> wrote:

> Those look pretty reasonable to me. :)
>
> Thanks for contributing to the documentation.
>
> -- Leah
>
>
> On Sat, Jul 12, 2014 at 11:21 AM, Matthew Wood <[email protected]> wrote:
>
>> I didn't find any examples in the docs for processing STDIN for more than
>> one read. I'm happy to contribute an example, but I wanted to make sure I
>> knew the best way.
>>
>> Reading lines from STDIN:
>>
>> for line = eachline(STDIN)
>>     print("Found: $line")
>> end
>>
>> Reading Chars:
>>
>> while !eof(STDIN)
>>     x = read(STDIN, Char)
>>     println("Found: $x")
>> end
>>
>> Does that look pretty reasonable?
>>
>> Thanks.
>> Matt Wood
>>
>
>

Reply via email to