[armedbear-devel] Function.execute and in-package

Pablo Duboue pablo.duboue at gmail.com
Tue Apr 12 12:48:21 UTC 2011


Hello,

How can I issue a Function.execute so that it executes in the context
of a given package?

That is, I have an instance of the Function class, obtained from a
.getSymbolFunction() call on a findAccessibleSymbol over a Package
instance, per the examples in the source tree. This function call
executes fine, but it runs on package "CL". I need it to run on
package, say, "FOO".

I have tried a number of things, to no avail:

* Issuing an interpreter.evaluate("(in-package "FOO")") beforehand.
That seemed very reasonable, but doesn't work. Looking into the code,
it seems related to packages being special bindings and said bindings
being reset between calls to evaluate.
* Fiddling with the thread.markSpecialBindings calls which seem to
reset in-package bindings in Lisp, Interpreter and Function. I haven't
had much success there, am I on the right track at all?
* Trying to use other calls instead of function.execute, which include
an environment and a thread, that was very cumbersome (and didn't work
either). Might this work at all...?
* Using the JSR-223 interface. That did work, but as I'm planning to
put this in a Web service, I don't want any interpreter on the way
(for security reasons). By the way, the JSR-223 page is the only
instance of "in-package" in the whole wiki. (The mailing list search
function for 'in-package' split it as two words and return half the
mailing list as output.)

Any pointers will be appreciated and I'll add the information to the
wiki afterward (suggesting where to put it will also be appreciated).

You can also reply on #abcl, my nick there is DrDub.

Gracias!

P.




More information about the armedbear-devel mailing list