fix atom_codes
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1238 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
ee8e119602
commit
3fce73a11f
@ -25,9 +25,9 @@
|
||||
:- dynamic node/4, reachable_from_evidence/2, evidence/2.
|
||||
|
||||
%
|
||||
% new evidence storagea algorithm. The idea is that instead of
|
||||
% new evidence storage algorithm. The idea is that instead of
|
||||
% redoing all the evidence every time we query the network, we shall
|
||||
% keep a precompiled version around. The precompiled
|
||||
% keep a precompiled version around.
|
||||
%
|
||||
% the format is as follows:
|
||||
% evidence_store:parent(Key,ParentList,[EvidenceChildren])
|
||||
|
@ -459,15 +459,14 @@ debugging :-
|
||||
'$action'(10,_,_,_,_) :- % newline creep
|
||||
( recorded('$spy_skip',_,R), erase(R), fail ; true ),
|
||||
'$set_yap_flags'(10,1).
|
||||
'$action'(33,_,_,_,_) :- !, % ! g execute
|
||||
'$action'(0'!,_,_,_,_) :- !, % ! g execute
|
||||
read(user,G),
|
||||
% don't allow yourself to be caught by creep.
|
||||
'$access_yap_flags'(10, CL),
|
||||
'$set_yap_flags'(10, 0),
|
||||
( '$execute'(G) -> true ; true),
|
||||
'$set_yap_flags'(10, CL),
|
||||
!,
|
||||
'$skipeol'(33),
|
||||
% '$skipeol'(0'!),
|
||||
fail.
|
||||
'$action'(0'<,_,_,_,_) :- !, % <Depth
|
||||
'$new_deb_depth',
|
||||
|
46
pl/utils.yap
46
pl/utils.yap
@ -477,20 +477,42 @@ garbage_collect_atoms :-
|
||||
'$good_character_code'(X) :- integer(X), X > -2, X < 256.
|
||||
|
||||
atom_concat(X,Y,At) :-
|
||||
var(X), var(Y), !,
|
||||
atom_length(At,Len),
|
||||
'$atom_contact_split'(At,0,Len,X,Y).
|
||||
/* Let atom_chars do our error handling */
|
||||
atom_concat(X,Y,At) :-
|
||||
atom_concat([X,Y],At).
|
||||
(
|
||||
nonvar(X), nonvar(Y)
|
||||
->
|
||||
atom_concat([X,Y],At)
|
||||
;
|
||||
atom(At) ->
|
||||
atom_length(At,Len),
|
||||
'$atom_contact_split'(At,0,Len,X,Y)
|
||||
;
|
||||
var(At) ->
|
||||
'$do_error'(instantiation_error,atom_concat(X,Y,At))
|
||||
;
|
||||
'$do_error'(type_error(atom,At),atomic_concant(X,Y,At))
|
||||
).
|
||||
|
||||
atomic_concat(X,Y,At) :-
|
||||
var(X), var(Y), !,
|
||||
atom_length(At,Len),
|
||||
'$atom_contact_split'(At,0,Len,X,Y).
|
||||
/* Let atom_chars do our error handling */
|
||||
atomic_concat(X,Y,At) :-
|
||||
atomic_concat([X,Y],At).
|
||||
(
|
||||
nonvar(X), nonvar(Y)
|
||||
->
|
||||
atomic_concat([X,Y],At)
|
||||
;
|
||||
atom(At) ->
|
||||
atom_length(At,Len),
|
||||
'$atom_contact_split'(At,0,Len,X,Y)
|
||||
;
|
||||
number(At) ->
|
||||
number_codes(At,Codes),
|
||||
'$append'(X0,Y0,Codes),
|
||||
name(X,X0),
|
||||
name(Y,Y0)
|
||||
;
|
||||
var(At) ->
|
||||
'$do_error'(instantiation_error,atomic_concat(X,Y,At))
|
||||
;
|
||||
'$do_error'(type_error(atomic,At),atomic_concant(X,Y,At))
|
||||
).
|
||||
|
||||
'$atom_contact_split'(At,Len,Len,X,Y) :- !,
|
||||
'$atom_split'(At,Len,X,Y).
|
||||
|
Reference in New Issue
Block a user