lua-users home
lua-l archive

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


> Lua provides some object 'syntactic sugar' allowing methods and such for
> those who like them but *until now* has never enforced this OO methodology
> on users. The new io library, however, seems to *require* using methods to
> read from general files.
>
> I have to say that I don't like this at all, and I also think it is very
> un-Lua (which like to keep things basic). It is also rather unnecessary.
> The io library could either provide an 'io.fread' command, or allow an
> optional file argument to the standard 'io.read'.

well i guess you can always do an:
	io.fread = stdin.read

to enable:
	io.fread(filehandle,format1, ...)

if you dislike:
	filehandle:read(format1, ...)

although i cannot understand why? do you want to avoid the additional
operator ":" ?

Cheers,
Peter