Re: suggestion: __typeof()
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: suggestion: __typeof()
- From: Lisa Parratt <lisa@...>
- Date: 2006年1月18日 11:19:53 +0000
Michael T. Richter wrote:
There is an obvious solution to this: wrap the metamethod inside the
interpreter. The metamethod returns as many values as it likes -- one
to one hundred -- and the engine calling the metamethod tacks on a
"userdata" to the beginning of it. Problem solved.
I'm always a fan of enforcing polite coding behaviour in the language. ;)
This is great for many uses, but totally kills the utility of the
function for proxy objects.
What if my userdata is a proxy for an external vector, and therefore
wants to present itself to Lua code as a table? With a simple __typeof
metamethod, it can simply return "table". With your proposed "forced
politeness", it's back to patching out idiot proofing before someone who
understands and accepts the consequences of their actions can use Lua to
it's full.
--
Lisa
http://www.thecommune.org.uk/~lisa/
- References:
- suggestion: __typeof(), Asko Kauppi
- Re: suggestion: __typeof(), Luiz Henrique de Figueiredo
- Re: suggestion: __typeof(), eugeny gladkih
- Re: suggestion: __typeof(), Luiz Henrique de Figueiredo
- Re: suggestion: __typeof(), Lisa Parratt
- Re: suggestion: __typeof(), Luiz Henrique de Figueiredo
- Re: suggestion: __typeof(), Lisa Parratt
- Re: suggestion: __typeof(), Alex Queiroz
- Re: suggestion: __typeof(), Asko Kauppi
- RE: suggestion: __typeof(), Dolan, Ryanne Thomas (UMR-Student)
- RE: suggestion: __typeof(), Michael T. Richter