lua-users home
lua-l archive

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


Following up on my earlier post, having to write:

    for v in iter( ... ) do
        -- process varargs
    end

Actually defeats some of the point since it must necessarily allocate storage proportional to the varargs since I might just as easily write:

    SomeGlobal = iter( ... )

(The point to "for v in ..." being to avoid that allocation and just use the existing values on the stack.)

Still it would be good to provide better support for ... in more contexts barring conflicts with existing syntax so that the quadratic tendencies of select could be minimized. One can do some of that now -- e.g., there's nothing stopping one from writing a version of iter -- but it would be good to standardize the mechanisms.

Mark