lua-users home
lua-l archive

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


On Feb 11, 2008 5:30 PM, Javier Guerra Giraldez <javier@guerrag.com> wrote:
> On Monday 11 February 2008, Peter Odding wrote:
> > Should the Lua API be extended to (transparently) treat callable objects
> > as functions in the appropriate contexts?
>
> ultimately, that could end in deprecating the value type concept in favor of
> capabilities.

I think that's the point. For instance, table.sort's default
comparator function only cares that the values you are sorting support
the < operator (and are of the same type). You don't need one function
for strings, another for numbers, another for tables, etc. It would
make sense, in terms of consistency, that any instance where a
function is accepted that a callable object is valid.