lua-users home
lua-l archive

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


It was thus said that the Great Roberto Ierusalimschy once stated:
> > Yes, since it only worked on raw tables in Lua 5.1, I can follow you
> > here. I wonder why __ipairs was introduced in Lua 5.2 in the first
> > place then?
> 
> Mainly to allow proxies and to ensure that tables with metamethods
> cannot be "raw"-accessed unless through explicit raw functions.
> 
> (Unfortunately, this last goal is broken: "pairs" over a table with
> no metatable returns a raw 'next' function that can be used over
> any table.)

  Not any more than C is broken for allowing raw pointer access, or C++ for
allowing unbridled operator overloading, or Perl for executing line noise,
or ... 

  -spc (Protect the programmer too much and you end up with Ada ... )