lua-users home
lua-l archive

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


> function assert(cond, err)
>  if cond then return cond
>  else error(err or "assertion failed")
>  end
> end

Not excactly. This one is closer:

function assert(cond, err, ...)
 if cond then return cond, err, ...
 else error(err or "assertion failed")
 end
end