[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string.gsub accepting a callable userdata
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 12 Dec 2012 11:50:46 -0200
> string.gsub is one of the most powerful Lua functions we have, and the
> substitution may be a string, a table, or a function.
>
> It would be useful if this list could be extended to include callable
> userdata - in most language interop situations I've encountered,
> foreign functions are represented in this way on the Lua side.
>
> (It would be too confusing to allow callable _tables_ of course)
What about indexable userdata? Given a userdata, should we use __index
or __call?
-- Roberto