make undefined more ISO compatible.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1425 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2005-10-29 01:28:37 +00:00
parent 12ea99994c
commit 8b801e571c
6 changed files with 71 additions and 15 deletions

View File

@ -11,8 +11,38 @@
* File: cdmgr.c *
* comments: Code manager *
* *
* Last rev: $Date: 2005-10-18 17:04:43 $,$Author: vsc $ *
* Last rev: $Date: 2005-10-29 01:28:37 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.170 2005/10/18 17:04:43 vsc
* 5.1:
* - improvements to GC
* 2 generations
* generic speedups
* - new scheme for attvars
* - hProlog like interface also supported
* - SWI compatibility layer
* - extra predicates
* - global variables
* - moved to Prolog module
* - CLP(R) by Leslie De Koninck, Tom Schrijvers, Cristian Holzbaur, Bart
* Demoen and Jan Wielemacker
* - load_files/2
*
* from 5.0.1
*
* - WIN32 missing include files (untested)
* - -L trouble (my thanks to Takeyuchi Shiramoto-san)!
* - debugging of backtrable user-C preds would core dump.
* - redeclaring a C-predicate as Prolog core dumps.
* - badly protected YapInterface.h.
* - break/0 was failing at exit.
* - YAP_cut_fail and YAP_cut_succeed were different from manual.
* - tracing through data-bases could core dump.
* - cut could break on very large computations.
* - first pass at BigNum issues (reported by Roberto).
* - debugger could get go awol after fail port.
* - weird message on wrong debugger option.
*
* Revision 1.169 2005/10/15 02:05:57 vsc
* fix for trying to add clauses to a C pred.
*
@ -4483,6 +4513,30 @@ p_predicate_erased_statistics(void)
}
#endif /* DEBUG */
static int
p_program_continuation(void)
{
PredEntry *pe = EnvPreg(((CELL *)ENV[E_E])[E_CP]);
if (pe->ModuleOfPred) {
if (!Yap_unify(ARG1,pe->ModuleOfPred))
return FALSE;
} else {
if (!Yap_unify(ARG1,TermProlog))
return FALSE;
}
if (pe->ArityOfPE) {
if (!Yap_unify(ARG2,MkAtomTerm(NameOfFunctor(pe->FunctorOfPred))))
return FALSE;
if (!Yap_unify(ARG3,MkIntegerTerm(ArityOfFunctor(pe->FunctorOfPred))))
return FALSE;
} else {
if (!Yap_unify(ARG2,MkAtomTerm((Atom)pe->FunctorOfPred)))
return FALSE;
if (!Yap_unify(ARG3,MkIntTerm(0)))
return FALSE;
}
return TRUE;
}
void
Yap_InitCdMgr(void)
@ -4539,6 +4593,7 @@ Yap_InitCdMgr(void)
Yap_InitCPred("$continue_static_clause", 5, p_continue_static_clause, SafePredFlag|SyncPredFlag|HiddenPredFlag);
Yap_InitCPred("$static_pred_statistics", 5, p_static_pred_statistics, SyncPredFlag|HiddenPredFlag);
Yap_InitCPred("$p_nth_clause", 4, p_nth_clause, SyncPredFlag|HiddenPredFlag);
Yap_InitCPred("$program_continuation", 3, p_program_continuation, SafePredFlag|SyncPredFlag|HiddenPredFlag);
#ifdef DEBUG
Yap_InitCPred("predicate_erased_statistics", 5, p_predicate_erased_statistics, SyncPredFlag);
#endif

View File

@ -120,12 +120,6 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
/* extern int gc_calls; */
vsc_count++;
if (vsc_count == 21857LL) {
jmp_deb(1);
}
if (vsc_count < 21800LL) {
return;
}
#ifdef COMMENTED
// if (vsc_count == 218280)
// vsc_xstop = 1;

View File

@ -16,6 +16,8 @@
<h2>Yap-5.1.0:</h2>
<ul>
<li> FIXED: make undefined excetpion more ISO like. </li>
<li> FIXED: add missing dependency in chr's Makefile.in. </li>
<li> FIXED: fix corruption in ypp.yap. </li>
<li> FIXED: ~@ makes format a meta-predicate. </li>
<li> FIXED: format should do immediate exit on exception (from Prolog call). </li>

View File

@ -1,7 +1,7 @@
#/bin/bash
# Guess what: this code works for me!
version="Yap-5.0.0"
version="Yap-5.1.0"
splat
cd C
splat
@ -21,7 +21,7 @@ cd ../clpr
splat
cd ../clp
splat
cd JPL
cd ../JPL
splat
cd src
splat

View File

@ -11,8 +11,11 @@
* File: errors.yap *
* comments: error messages for YAP *
* *
* Last rev: $Date: 2005-10-28 17:38:50 $,$Author: vsc $ *
* Last rev: $Date: 2005-10-29 01:28:37 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.67 2005/10/28 17:38:50 vsc
* sveral updates
*
* Revision 1.66 2005/10/18 17:04:43 vsc
* 5.1:
* - improvements to GC
@ -589,9 +592,9 @@ print_message(Level, Mss) :-
'$output_error_message'(existence_error(queue,F), W) :-
format(user_error,'% EXISTENCE ERROR- ~w could not open message queue ~w~n',
[W,F]).
'$output_error_message'(existence_error(procedure,P), _) :-
format(user_error,'% EXISTENCE ERROR- procedure ~w undefined~n',
[P]).
'$output_error_message'(existence_error(procedure,P), context(Call,Parent)) :-
format(user_error,'% EXISTENCE ERROR- procedure ~w is undefined, called from context ~w~n% Goal was ~w~n',
[P,Parent,Call]).
'$output_error_message'(existence_error(source_sink,F), W) :-
format(user_error,'% EXISTENCE ERROR- ~w could not find file ~w~n',
[W,F]).

View File

@ -456,8 +456,10 @@ unknown(V0,V) :-
arg(1,X,A),
recorda('$unknown','$unknown'(A,M:X),_).
'$unknown_error'(P) :-
'$do_error'(unknown,P).
'$unknown_error'(Mod:Goal) :-
functor(Goal,Name,Arity),
'$program_continuation'(PMod,PName,PAr),
'$do_error'(existence_error(procedure,Name/Arity),context(Mod:Goal,PMod:PName/PAr)).
'$unknown_warning'(P) :-
P=M:F,