Meta-interpreters for dynamic dispatch with call/n #2618
-
I've been trying to write a reduce/foldl which works in either direction, and have the following code, which works fine afaict. But I cannot run it in a meta-interpreter because it uses As I understand it, Is there a way to write an mi that processes goals containing
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
What exactly are you doing in your meta-interpreter that needs the predicate to be public? Are you using But anyway, I think you can just special case |
Beta Was this translation helpful? Give feedback.
What exactly are you doing in your meta-interpreter that needs the predicate to be public? Are you using
clause/2
or something similar to get the body of a predicate to meta-interpret? I feel like just passing the source code as an argument may be a better idea.But anyway, I think you can just special case
call/n
or(=..)/2
or any other predicate in your meta-interpreter so that you just trust it and don't need to introspect into it's definition.