lua-users home
lua-l archive

Re: io:lines() and 0円

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> On Feb 21, 2014, at 5:59 PM, Sean Conner <sean@conman.org> wrote:
>
> It was thus said that the Great René Rebe once stated:
>>
>> Instead of doing it right, look for others who do it worse?
>
> I think it's more an investigation of "how do other languages handle
> this?" than trying to look for worse.
>
> C, using fgets(), would print:
>
> hellohellohellohellohello
That's exactly what I was wondering. How do other languages handle
this situation? I tried Python, Perl, Ruby, and TCL. They all seem to
support his expectation and what I would have imagined would be
returned:
 $ python io.py
 12 helloworld
 12 helloworld
 12 helloworld
 $ ruby io.rb
 12 helloworld
 12 helloworld
 12 helloworld
 $ tclsh io.tcl
 11 helloworld
 11 helloworld
 11 helloworld
 $ perl io.pl
 helloworld
 helloworld
 helloworld
 $ lua io.lua
 15 hellohellohello

AltStyle によって変換されたページ (->オリジナル) /