lua-users home
lua-l archive

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


On Tue, 2006-17-01 at 15:59 -0600, Dolan, Ryanne Thomas (UMR-Student) wrote:
Now, of course if I define a __typeof metamethod that only returns one value, then it can potentially break older code.  But it should be up to the programmers whether to include backwards compatibility in their scripts.  The language should not be held back just because an improvement might allow a poor programmer to break older, poorer code.  Coming up with some patch is a way worse alternative.

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.  ;)

--
Michael T. Richter
Email: ttmrichter@gmail.com, mtr1966@hotpop.com
MSN: ttmrichter@hotmail.com, mtr1966@hotmail.com; YIM: michael_richter_1966; AIM: YanJiahua1966; ICQ: 241960658; Jabber: mtr1966@jabber.cn

Attachment: signature.asc
Description: This is a digitally signed message part