-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lambda with a predicate: existence error after "two unifications" #2619
Comments
Probably related to #2255. |
In SICStus, the existence error also indicates the module where that error occurs. |
Could you disassemble the WAM code just to see what has been compiled there? |
test1: The "as expected" case:
test2: The "existence error" case:
|
Any easy way to tell what module we are in? (I hoped it would show here, but this |
I'm sorry, everything I know is here. I did not explicitly defined any module, I only loaded the file with the predicates test1/0 and test2/0 from the command line. |
The documentation of |
I'm sorry. I'm only a naive user, not the right person to understand things here...
|
I see... the "existence_error", like: we: the Prolog system suddenly does not see the definition/predicate; as if the system is looking for the definition in the wrong context/module... |
In some sense, your query But then, (after consulting your original program):
So what is happening with these asserts?? |
This works as expected: ?- [user].
l:length(_,_) :- throw(ha_gotit).
?- l:length(A,B).
throw(ha_gotit).
?- So it is only problem with assertions |
Also after studying source code of loader.pl I can tell that correct modules are added to arguments of meta-predicates during (more-or-less) goal expansion. And code here is quite tricky and has a lot of special-cases, for example so called transitive goals which work afaik only for sequences of unifications using |
Loading lambda and, for example, lists library:
Through "one unification", so to speak, as expected:
The unexpected existence error examples:
But, for example, this works as expected:
PS: It's not about the lists library, I could consult my own file with my own predicate in a lambda expression used in this way with the same "existence error" effect.
The text was updated successfully, but these errors were encountered: