lua-users home
lua-l archive

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


> [PHP] "create_function" looks kind of clunky...
>
> array_walk( $recordForView,
> create_function('&$item1,$key,$prefix',
>                 '$item1=($item1 == "on")?$prefix:""'),
> '*** ADD ***');

Lua:

table.foreach(recordForView, function(k,v) if v == "on" then
recordForView[k]='*** ADD ***' end end )

That's nice...

-R