[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Disabling assert function
- From: Romulo <romuloab@...>
- Date: Thu, 20 May 2010 12:06:16 -0300
> That is cute. The basic problem is how to 'quote' an operation so
> that it can be executed later.
I don't understand what this "quote an operation" problem is. What I
do is to parse (string.find) the string, extract expressions within
curly braces and eval then as Lua functions, with a special
environment which knows about locals, and then insert back the
tostring()'ed version of the result, and that's it.
The cost of mine approach? One string literal when the assertion
expression evals to true, or some closures and tables when it
evaluates to false, but considering that you don't want them to
evaluate to false, it is not much cost at all.
--rb
- 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