lua-users home
lua-l archive

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


On Wed, 10 May 2000 rw20@cornell.edu wrote:

> Something like 
> 
> $define debugging true
> 
> function test(x)
>   if debugging then
>     if type(x) ~= 'table' then
>        RuntimeError('x is not a table')
>     end
>   end
>   print(x.name)
> end

I would be happy with this.  I would be even happier if that were replaced
by:

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.

F