lua-users home
lua-l archive

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


On Mon, May 24, 2010 at 2:57 PM, M Joonas Pihlaja
<jpihlaja@cc.helsinki.fi> wrote:
> I'm slightly wary of your proposal because it 1) adds even more
> implicit magic to the language

No more magical than metatables in general, in my opinion, but okay.

> 2) breaks the current iterator protocol

Hrm, I tried to make sure it didn't do that. What about it does this?
It takes the first item on the right and first tries its __iter, then
tries to call it. All current uses I can reasonably think of should
still work unchanged.

> 3) is likely to have significant overhead in the loop setup
> compared to explicit numeric for loops.

Fair enough.

~Jonathan