lua-users home
lua-l archive

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


Alexander Gladysh wrote:
> On Sat, Aug 27, 2011 at 11:29, Alexander Gladysh <agladysh@gmail.com> wrote:
> > 1. I'm content with the fact that the pairs() would always be slow.
> >
> > 2. However, if pairs() abort the trace of any function...
> >
> > 3. ...Then that *any* function may never be compiled to the native code.
> >
> > 4. And that function may do something complex and optimizable besides
> > calling pairs()...
> >
> > 5. ...Which would never be optimized due to #3.
> >
> > So, should I, for example, move the body of a loop with pairs() to the
> > separate function so it would be compiled? Or what?
> 
> Mike, I'm very sorry to waste your time on dumb questions, but could
> you please shed some light here? ("No" or "Yes" would suffice if
> you're too busy to give a detailed answer.)

1. Happily ignoring my advice.
2. Yes.
3. Not if the function itself doesn't contain the call to next().
4. See 1.
5. No.
6. Why don't you try? -jv tells you what happens.

--Mike