[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: '__iter', yet again!
- From: spir <denis.spir@...>
- Date: Wed, 16 Dec 2009 19:33:57 +0100
"John Hind" <firstname.lastname@example.org> 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