Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3

This commit is contained in:
Vítor Santos Costa 2012-03-22 22:23:58 +00:00
commit caf9b757f3
5 changed files with 32 additions and 19 deletions

View File

@ -52,17 +52,7 @@ send_tracer_message(char *start, char *name, Int arity, char *mname, CELL *args)
if (args) { if (args) {
for (i= 0; i < arity; i++) { for (i= 0; i < arity; i++) {
if (i > 0) fprintf(GLOBAL_stderr, ","); if (i > 0) fprintf(GLOBAL_stderr, ",");
#if DEBUG Yap_plwrite(args[i], NULL, 15, Handle_vars_f|AttVar_Portray_f, 1200);
#if COROUTINING
Yap_Portray_delays = TRUE;
#endif
#endif
Yap_plwrite(args[i], NULL, 15, Handle_vars_f, 1200);
#if DEBUG
#if COROUTINING
Yap_Portray_delays = FALSE;
#endif
#endif
} }
if (arity) { if (arity) {
fprintf(GLOBAL_stderr, ")"); fprintf(GLOBAL_stderr, ")");

View File

@ -1014,13 +1014,15 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str
wrputc(')', wglb->stream); wrputc(')', wglb->stream);
lastw = separator; lastw = separator;
} }
/* avoid quoting commas */ /* avoid quoting commas and bars */
if (strcmp(RepAtom(atom)->StrOfAE,",")) if (!strcmp(RepAtom(atom)->StrOfAE,",")) {
putAtom(atom, wglb->Quote_illegal, wglb);
else {
wrputc(',', wglb->stream); wrputc(',', wglb->stream);
lastw = separator; lastw = separator;
} } else if (!strcmp(RepAtom(atom)->StrOfAE,"|")) {
wrputc('|', wglb->stream);
lastw = separator;
} else
putAtom(atom, wglb->Quote_illegal, wglb);
if (bracket_right) { if (bracket_right) {
wrputc('(', wglb->stream); wrputc('(', wglb->stream);
lastw = separator; lastw = separator;

View File

@ -54,6 +54,27 @@ length(L, M) :-
M is N + 1, NL = [_|L], '$$_length2'(L, O, M) ). M is N + 1, NL = [_|L], '$$_length2'(L, O, M) ).
sort(L,O) :- sort(L,O) :-
'$skip_list'(L,NL,RL),
( RL == [] -> true ;
var(RL) -> '$do_error'(instantiation_error,sort(L,O)) ;
'$do_error'(type_error(list,L),sort(L,O))
),
(
nonvar(O)
->
(
O == []
->
L == []
;
'$skip_list'(O,NO,RO),
( RO == [] -> NO =< NL ;
var(RO) -> NO =< NL ;
'$do_error'(type_error(list,O),sort(L,O))
)
)
; true
),
'$sort'(L,O). '$sort'(L,O).
msort(L,O) :- msort(L,O) :-

View File

@ -209,7 +209,7 @@ thread_create(Goal, Id, Options) :-
% vsc: ????? % vsc: ?????
thread_defaults(Defaults) :- thread_defaults(Defaults) :-
nonvar(Defaults), !, nonvar(Defaults), !,
'$do_error'(uninstantion_error(Defaults), thread_defaults(Defaults)). '$do_error'(uninstantiation_error(Defaults), thread_defaults(Defaults)).
thread_defaults([stack(Stack), trail(Trail), system(System), detached(Detached), at_exit(AtExit)]) :- thread_defaults([stack(Stack), trail(Trail), system(System), detached(Detached), at_exit(AtExit)]) :-
recorded('$thread_defaults',[Stack, Trail, System, Detached, AtExit], _). recorded('$thread_defaults',[Stack, Trail, System, Detached, AtExit], _).

View File

@ -93,13 +93,13 @@
'$check_op_name'(_,_,',',G) :- !, '$check_op_name'(_,_,',',G) :- !,
'$do_error'(permission_error(modify,operator,','),G). '$do_error'(permission_error(modify,operator,','),G).
'$check_op_name'(_,_,'[]',G) :- !, '$check_op_name'(_,_,'[]',G) :- !,
'$do_error'(permispsion_error(create,operator,'[]'),G). '$do_error'(permission_error(create,operator,'[]'),G).
'$check_op_name'(_,_,'{}',G) :- !, '$check_op_name'(_,_,'{}',G) :- !,
'$do_error'(permission_error(create,operator,'{}'),G). '$do_error'(permission_error(create,operator,'{}'),G).
'$check_op_name'(P,T,'|',G) :- '$check_op_name'(P,T,'|',G) :-
( (
integer(P), integer(P),
P < 1001 P < 1001, P > 0
; ;
atom_codes(T,[_,_]) atom_codes(T,[_,_])
), !, ), !,