lua-users home
lua-l archive

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


2013/7/19 Hisham <h@hisham.hm>:

> if this is to be made more general than
> just for math, then maybe just add the feature to type() itself, as in
> type(v [, mode]) -- if given a second argument (true?) then type
> returns the specific subtype, if not, the general type.

Or type could return typename,subtypename, where subtypename
could be obj:type() if typename is not 'number'.

   print(type(io.stdin))
userdata    file
   print(type(1))
number    integer