[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: transferring logical expression from lua to c
- From: Oskar Forsslund <matrixsmurfen@...>
- Date: Wed, 19 Oct 2011 15:36:10 +0200
but how can I run that lua function in C? can I at all?
I thought about converting the logical operators but in any case I would have to parse the lua stack (with lookahead to make the associativity of the operators to work correctly) and I think this might be too costly
again my question might have been badly formulated
but with "transfer" I mean I want C to evaluate it for me
On Wed, Oct 19, 2011 at 3:27 PM, steve donovan <email@example.com>
You would need to wrap it as a table structure
On Wed, Oct 19, 2011 at 3:19 PM, Oskar Forsslund
> I should have been clearer. I mean without just writing it in C, I want to
> transfer the actual _expression_ from lua to C at runtime
and 'interpret' that structure. This might be acceptable if your
functions are relatively expensive.
But then, what stops you from passing a Lua function?
function() func1() and func2() and (func3() or func4()) end
(could be cached)