[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Disabling assert function
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 20 May 2010 13:08:07 -0300
> At the risk of stirring things up, this is where the short-lambda form
> can be useful:
>
> assertc (mob:isalive(), || "the mob "..mob.name.." must be alive")
>
> function assertc(condn,fun)
> if not condn then assert(false,fn()) end
> end
>
> The cost? Lots of little closures.
>
> Increasingly thinking that this is one of the few places where those
> unfashionable things, macros, are actually useful.
You actually presented two: asserts and short-lambda forms ;)
-- Roberto
- References:
- Disabling assert function, Nikolai Kondrashov
- Re: Disabling assert function, Alex Davies
- Re: Disabling assert function, Nikolai Kondrashov
- Re: Disabling assert function, steve donovan
- Re: Disabling assert function, Nikolai Kondrashov
- Re: Disabling assert function, HyperHacker
- Re: Disabling assert function, Nikolai Kondrashov
- Re: Disabling assert function, Marc OMorain
- Re: Disabling assert function, Romulo
- Re: Disabling assert function, steve donovan