lua-users home
lua-l archive

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


Yes, it would be cool if these library functions were expecting a
'callable' and did the metatable lookup. Shouldn't be expensive, and
would make a nice patch!

steve d.

On Feb 7, 2008 11:32 AM, Miles Bader <miles.bader@necel.com> wrote:
> nice :-)
>
> It's a shame so many places seem to explicitly check the type of
> things...
>
>    table.foreach ({1,2 , 5, 9}, "|x|x+1")
>    stdin:1: bad argument #2 to 'foreach' (function expected, got string)
>
> blargh...
>
> -Miles
>
> --
> Omochiroi!
>