On Mon, Oct 24, 2011 at 06:46:38PM +0200, Michael Hanselmann wrote:
> A new script, “autotools/build-rpc”, will be used to generate code for
> RPC client wrappers. This is done because “lib/rpc.py” contains lots and
> lots of boilerplate code. Forthcoming patches will start converting
> RPC wrappers.
OK, I might have misunderstood our local discussion a while back (when
you asked about run-time versus build-time code generation).
My questions is whether we need to "generate" code at all, instead of
parsing the descriptor tables and doing the serialisation at run time,
e.g.:
def GenericCall(name, params):
defs = DESCRIPTOR[name]
if len(defs) != len(params):
fail "invalid params"
new_args = [fn(p) for fn, p in zip(defs, params]
call(name, new_args)
?
iustin