lua-users home
lua-l archive

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


Peter Prade:
> well i guess you can always do an:
> io.fread = stdin.read
>
> to enable:
> io.fread(filehandle,format1, ...)
>
> if you dislike:
> filehandle:read(format1, ...)

Peter Hill:
>Huh? I don't follow this.

I guess the stdin stuff mislead you: stdin is just a handy filehandle
that's always available. But once you have any filehandle, you can
do io.fread = filehandle.read and get your function as above. That
filehandle.read is the function you want should be clear from the
definition of ":" as syntax sugar.
--lhf