lua-users home
lua-l archive

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

"John Hind" <> dixit:

> So we are back were we started (or have I missed something?) - what is
> needed is a new metamethod which is invoked when the explist of a generic
> for fails to resolve a function in its first slot. The object designer could
> put an iterator factory function in this slot which can return any form of
> iterator including stateless.
> I really cannot see why this solution is resisted - it is fully backward
> compatible and syntactically uncomplicated. The context of the explist is
> easily distinguishable being bracketed by the reserved words 'in' and 'do'.

I support this view. 'in' is an operator-like keyword which deserves its own metamethod. It would make everything easier and more supple.


la vita e estrany