Attached is a patch + a Java class that tentatively implement
logicmoo's idea of "inlining" primitives as calls to static methods
(just for test on a single primitive, COPY-TREE).
The Java class, InlinedPrimitive, extends Primitive and implements its
execute() methods with static methods with a given name found in a
given class.
When interpreted or passed as a higher-order function an
InlinedPrimitive calls the static method through reflection, resulting
in slower performance than now.
But, when compiled it is translated as a direct call to the static
method, without passing through the symbol, which is faster than now
(I haven't measured how much faster).
Consider this patch as a rough draft - it must be polished if we ever
decide to include it. In particular "inlining" is always performed,
while we should probably avoid it with some debug/speed settings.
Bye,
Alessio