lua-users home
lua-l archive

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

Am 27.03.2011 11:41, schrieb Daurnimator:
I do see merit in this; many times I've been bitten by not being able
to reuse memory in calculations
eg, a=b+c*d
==>  a temporary object (for c*d) is created; and using one of the
operand's memory is difficult, if not impossible for some

Only as a Sunday morning thoughts from me:
Ideally, a library knows best how to handle a complex expression of their own objects.
So, one have to bring the complete expression into the library, but how?

Suppose a C + + math library-"MyDream" know themselves how a complex compound expressions such as "A = (B * C + D) * E" is to handle intelligently. Could Lua call my mydream library with the AST of "A=(B * C + D) * E" instead of evaluating it itself somehow?

Mmh... sound a like a job for metalua...