?- [user].
[_] :- foo.
|:
true.
2 ?- [user].
ERROR: '[|]'/2: Undefined procedure: foo/0
Exception: (8) foo ? abort
% Execution Aborted
What I wonder, why I dont get an error message when I overwrite '[|]'/2 ?
?- [user].
write(_) :- foo.
ERROR: user://1:9:
No permission to modify static procedure `write/1'
But this is only because it is a foreign predicate. For non-foreign predicates
overwriting works unwarned:
append(_,_,_) :- foo.
|:
true.
2 ?- append(x,y,z).
ERROR: append/3: Undefined procedure: foo/0
Exception: (8) foo ? creep
?- listing('[|]'/_).
:- meta_predicate[:|+].
system:[A] :- !,
consult(A).
system:[A:B|C] :-
consult(A:[B|C]).
Whats the sickness and what is the cure?
Bye
P.S.: Here is what I did in Jekejeke, if a predicate isn't multifile
from the beginning, there is no chance at all to redefine a non-
module predicate in a non-module text:
?- [user].
[_] :- foo.
Error: Can't redefine predicate '.'/2, not marked multfile.
You can redefined a non-module predicate in a module text.
And you can redefined a module predicate in a non-module text.
Here is an example of the later:
?- [user].
member(_,_) :- foo.
Warning: Overriding predicate member/2, declare accordingly.
As can be seen, one gets a warning. Which one can disable for
the given predicate if one does an override directive first:
:- override member/2.
member(_,_) :- bar.
procedure `foo' does not exist Reachable from: [A|B] swish_trace:swish_call([user]) '$swish wrapper'([user],A)If I hoover over the query it still says "[/2 Read (compile) a
> <mailto:swi-prolog+unsub...@googlegroups.com>.