Closed torbjornlager closed 6 years ago
If ask/4 is successfully called in the process, adding a meta-predicate declaration as in
:- meta_predicate ask(0, +, +, +).
will probably do.
P.s. please keep Options as last argument.
No, that didn't do it. It has the effect that the first arg of ask/4
gets bound to pengines:Goal
.
The initial goal called from the spawn gets the right module context. From there on you must make sure not to loose that.
Ok, thanks. I think I got it now.
context_module/1 has to be declared safe in the sandbox for it to work also in the case of remote pengines.
You shouldn't need it. Use meta_predicate/1 declaration. Normally you can just pass on the qualified argument from there. In some extreme cases you match the Module:Term
argument to pick up the module and reuse it in some other way.
I'm afraid I don't quite get that. The initial goal called from the spawn (session/3) doesn't have a qualified argument. The ask/4 predicate is called later - too late, isn't it?
So, you must define session/3 as a meta-predicate as you want it to know its context. If there is no clear module-sensitve argument, just specify the most sensible argument as :
and pick it up as Module:Term
in the head of session/3.
Aha, now I got it!
The pengines currently does not work with the src_* options. It seems that we somehow need to get the name of the module used for isolation into the right place, like below. But how to do that?