lua-users home
lua-l archive

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


> function test(x)
>   $assert( type(x) == 'table' )
>   print(x.name)
> end
> 
> You might control compiling or not-compiling the $assert function call
> through the $debug macro.

That would work.  I guess you'd need to write a local function to call if 
there was more work to do, but more code space is OK while more execution 
time is not.

The runtime overhead of

function test(x)
  local debug_code = function(x) ... end
  $assert( debug_code(x) )
  print(x.name)
end