a new and hopefully much better implementation of atts.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1392 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2005-09-09 17:24:39 +00:00
parent 2444b775b7
commit 03ba05f24a
14 changed files with 624 additions and 495 deletions

View File

@@ -313,8 +313,8 @@ write_var(CELL *t, struct write_globs *wglb)
Yap_Portray_delays = FALSE;
if (ext == attvars_ext) {
attvar_record *attv = (attvar_record *)t;
int i;
long sl = 0;
Term l = attv->Atts;
wrputs("$AT(",wglb->writech);
write_var(t, wglb);
@@ -324,26 +324,12 @@ write_var(CELL *t, struct write_globs *wglb)
sl = Yap_InitSlot((CELL)attv);
}
writeTerm((Term)&(attv->Value), 999, 1, FALSE, wglb);
wrputc(',', wglb->writech);
writeTerm(l, 999, 1, FALSE, wglb);
if (wglb->keep_terms) {
attv = (attvar_record *)Yap_GetFromSlot(sl);
Yap_RecoverSlots(1);
}
for (i = 0; i < NUM_OF_ATTS; i ++) {
if (!IsVarTerm(attv->Atts[2*i+1])) {
long sl = 0;
wrputc(',', wglb->writech);
if (wglb->keep_terms) {
/* garbage collection may be called */
sl = Yap_InitSlot((CELL)attv);
}
writeTerm((Term)&(attv->Atts[2*i+1]), 999, 1, FALSE, wglb);
if (wglb->keep_terms) {
attv = (attvar_record *)Yap_GetFromSlot(sl);
Yap_RecoverSlots(1);
}
}
}
wrputc(')', wglb->writech);
}
Yap_Portray_delays = TRUE;