diff --git a/C/tracer.c b/C/tracer.c index 74da2a1bc..d8e686db1 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -52,17 +52,7 @@ send_tracer_message(char *start, char *name, Int arity, char *mname, CELL *args) if (args) { for (i= 0; i < arity; i++) { if (i > 0) fprintf(GLOBAL_stderr, ","); -#if DEBUG -#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 + Yap_plwrite(args[i], NULL, 15, Handle_vars_f|AttVar_Portray_f, 1200); } if (arity) { fprintf(GLOBAL_stderr, ")"); diff --git a/C/write.c b/C/write.c index 93b8f30c6..0c078ad93 100644 --- a/C/write.c +++ b/C/write.c @@ -1014,13 +1014,15 @@ writeTerm(Term t, int p, int depth, int rinfixarg, struct write_globs *wglb, str wrputc(')', wglb->stream); lastw = separator; } - /* avoid quoting commas */ - if (strcmp(RepAtom(atom)->StrOfAE,",")) - putAtom(atom, wglb->Quote_illegal, wglb); - else { + /* avoid quoting commas and bars */ + if (!strcmp(RepAtom(atom)->StrOfAE,",")) { wrputc(',', wglb->stream); lastw = separator; - } + } else if (!strcmp(RepAtom(atom)->StrOfAE,"|")) { + wrputc('|', wglb->stream); + lastw = separator; + } else + putAtom(atom, wglb->Quote_illegal, wglb); if (bracket_right) { wrputc('(', wglb->stream); lastw = separator; diff --git a/pl/sort.yap b/pl/sort.yap index cbbc7ca1e..5b09c4379 100644 --- a/pl/sort.yap +++ b/pl/sort.yap @@ -54,6 +54,27 @@ length(L, M) :- M is N + 1, NL = [_|L], '$$_length2'(L, O, M) ). 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). msort(L,O) :- diff --git a/pl/threads.yap b/pl/threads.yap index 2d84b7692..cf856b671 100644 --- a/pl/threads.yap +++ b/pl/threads.yap @@ -209,7 +209,7 @@ thread_create(Goal, Id, Options) :- % vsc: ????? thread_defaults(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)]) :- recorded('$thread_defaults',[Stack, Trail, System, Detached, AtExit], _). diff --git a/pl/utils.yap b/pl/utils.yap index 83306a5d3..28e519b35 100644 --- a/pl/utils.yap +++ b/pl/utils.yap @@ -93,13 +93,13 @@ '$check_op_name'(_,_,',',G) :- !, '$do_error'(permission_error(modify,operator,','),G). '$check_op_name'(_,_,'[]',G) :- !, - '$do_error'(permispsion_error(create,operator,'[]'),G). + '$do_error'(permission_error(create,operator,'[]'),G). '$check_op_name'(_,_,'{}',G) :- !, '$do_error'(permission_error(create,operator,'{}'),G). '$check_op_name'(P,T,'|',G) :- ( integer(P), - P < 1001 + P < 1001, P > 0 ; atom_codes(T,[_,_]) ), !,