Replies: 2 comments 7 replies
-
For 1st case I found a workaround – add this to your code: :- use_module(library(format)).
user:term_expansion(G, _) :-
nonvar(G),
functor(G, ',', _),
prolog_load_context(file, F),
prolog_load_context(term_position, position_and_lines_read(_,L)),
format(user_error, "% Warning: (~q) attempts to re-define ','/2 at line ~d of ~a~n", [G,L,F]),
false. And it will report a little bit of context, so it would be easier to find it:
|
Beta Was this translation helpful? Give feedback.
7 replies
-
Another one: test(T) :-
T == call(a->b;c). If predicate has a lot of lines of code then this type or error is very hard to find. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here I will collect syntax errors that are difficult to find, so if we will have an improved parser in the future it can be tested against those cases:
Code can't be compiled, Scryer just reports an exception:
error(permission_error(modify,static_procedure,(',')/2),load/1).
no information about source location, very hard to find and can easily happen if you copy code from one predicate to another.Scryer reports error at misleading place:
error(syntax_error(incomplete_reduction),read_term/3:7).
. After such error I usually think that the problem is in a body ofy/0
, but actual problem is non-terminated previous predicate.Beta Was this translation helpful? Give feedback.
All reactions