BSD 4 release
[unix-history] / usr / src / cmd / lisp / lamr.c
index ea6427e..bb93b3a 100644 (file)
@@ -1,5 +1,6 @@
+static char *sccsid = "@(#)lamr.c      34.3 10/31/80";
+
 # include "global.h"
 # include "global.h"
-# include <a.out.h>
 
 /************************************************************************/
 /*                                                                     */
 
 /************************************************************************/
 /*                                                                     */
@@ -15,7 +16,7 @@ Lalloc()
        int n;
        register struct argent *mylbot = lbot;
        snpand(1);
        int n;
        register struct argent *mylbot = lbot;
        snpand(1);
-       chkarg(2);
+       chkarg(2,"alloc");
        if(TYPE((mylbot+1)->val) != INT && (mylbot+1)->val != nil )
                error("2nd ARGUMENT TO ALLOCATE MUST BE AN INTEGER",FALSE);
        n = 1;
        if(TYPE((mylbot+1)->val) != INT && (mylbot+1)->val != nil )
                error("2nd ARGUMENT TO ALLOCATE MUST BE AN INTEGER",FALSE);
        n = 1;
@@ -26,14 +27,14 @@ Lalloc()
 lispval
 Lsizeof()
        {
 lispval
 Lsizeof()
        {
-       chkarg(1);
+       chkarg(1,"sizeof");
        return(inewint(csizeof(lbot->val)));
        }
 
 lispval
 Lsegment()
        {
        return(inewint(csizeof(lbot->val)));
        }
 
 lispval
 Lsegment()
        {
-       chkarg(2);
+       chkarg(2,"segment");
 chek:  while(TYPE(np[-1].val) != INT )
                np[-1].val=error("LENGTH ARG TO SEGMENT MUST BE INTEGER",TRUE);
        if( np[-1].val->i < 0 )
 chek:  while(TYPE(np[-1].val) != INT )
                np[-1].val=error("LENGTH ARG TO SEGMENT MUST BE INTEGER",TRUE);
        if( np[-1].val->i < 0 )
@@ -41,7 +42,7 @@ chek: while(TYPE(np[-1].val) != INT )
                np[-1].val = error("LENGTH ARG TO SEGMENT MUST BE POSITIVE",TRUE);
                goto chek;
                }
                np[-1].val = error("LENGTH ARG TO SEGMENT MUST BE POSITIVE",TRUE);
                goto chek;
                }
-       return(csegment((lbot)->val,np[-1].val->i));
+       return(csegment((lbot)->val,np[-1].val->i,FALSE));
        }
 
 /*  Lforget  *************************************************************/
        }
 
 /*  Lforget  *************************************************************/
@@ -54,20 +55,18 @@ Lforget()
        char c,*name;
        struct atom *buckpt;
        int hash;
        char c,*name;
        struct atom *buckpt;
        int hash;
-       chkarg(1);
+       chkarg(1,"forget");
        if(TYPE(lbot->val) != ATOM)
        if(TYPE(lbot->val) != ATOM)
-               error("CANNOT FORGET NON-ATOM",FALSE);
-       name = lbot->val->pname;
-       hash = 0;
-       while( (c = *name++) != NULL_CHAR) hash ^= c;
-       hash = hash & 0177;
+               error("remob: non-atom argument",FALSE);
+       name = lbot->val->a.pname;
+       hash = hashfcn(name);
 
        /*  We have found the hash bucket for the atom, now we remove it  */
 
        if( hasht[hash] == (struct atom *)lbot->val )
                {
 
        /*  We have found the hash bucket for the atom, now we remove it  */
 
        if( hasht[hash] == (struct atom *)lbot->val )
                {
-               hasht[hash] = lbot->val->hshlnk;
-               lbot->val->hshlnk = (struct atom *)CNIL;
+               hasht[hash] = lbot->val->a.hshlnk;
+               lbot->val->a.hshlnk = (struct atom *)CNIL;
                return(lbot->val);
                }
 
                return(lbot->val);
                }
 
@@ -76,8 +75,8 @@ Lforget()
                {
                if(buckpt->hshlnk == (struct atom *)lbot->val)
                        {
                {
                if(buckpt->hshlnk == (struct atom *)lbot->val)
                        {
-                       buckpt->hshlnk = lbot->val->hshlnk;
-                       lbot->val->hshlnk = (struct atom *)CNIL;
+                       buckpt->hshlnk = lbot->val->a.hshlnk;
+                       lbot->val->a.hshlnk = (struct atom *)CNIL;
                        return(lbot->val);
                        }
                buckpt = buckpt->hshlnk;
                        return(lbot->val);
                        }
                buckpt = buckpt->hshlnk;
@@ -91,16 +90,16 @@ Lforget()
 lispval
 Lgetl()
        {
 lispval
 Lgetl()
        {
-       chkarg(1);
+       chkarg(1,"getlength");
        if(TYPE(lbot->val) != ARRAY)
                error("ARG TO GETLENGTH MUST BE AN ARRAY",TRUE);
        if(TYPE(lbot->val) != ARRAY)
                error("ARG TO GETLENGTH MUST BE AN ARRAY",TRUE);
-       return(lbot->val->length);
+       return(lbot->val->ar.length);
        }
 
 lispval
 Lputl()
        {
        }
 
 lispval
 Lputl()
        {
-       chkarg(2);
+       chkarg(2,"putlength");
        if(TYPE((lbot)->val) != ARRAY)
                error("ARG TO PUTLENGTH MUST BE AN ARRAY",FALSE);
 chek:  while(TYPE(np[-1].val) != INT)
        if(TYPE((lbot)->val) != ARRAY)
                error("ARG TO PUTLENGTH MUST BE AN ARRAY",FALSE);
 chek:  while(TYPE(np[-1].val) != INT)
@@ -110,68 +109,87 @@ chek:     while(TYPE(np[-1].val) != INT)
                np[-1].val = error("ARRAY LENGTH MUST BE POSITIVE",TRUE);
                goto chek;
                }
                np[-1].val = error("ARRAY LENGTH MUST BE POSITIVE",TRUE);
                goto chek;
                }
-       return((lbot)->val->length = np[-1].val);
+       return((lbot)->val->ar.length = np[-1].val);
        }
 lispval
 Lgetdel()
        {
        }
 lispval
 Lgetdel()
        {
-       chkarg(1);
+       chkarg(1,"getdelta");
        if(TYPE(lbot->val) != ARRAY)
                error("ARG TO GETDELTA MUST BE AN ARRAY",FALSE);
        if(TYPE(lbot->val) != ARRAY)
                error("ARG TO GETDELTA MUST BE AN ARRAY",FALSE);
-       return(lbot->val->delta);
+       return(lbot->val->ar.delta);
        }
 
 lispval
 Lputdel()
        {
        }
 
 lispval
 Lputdel()
        {
-       chkarg(2);
+       chkarg(2,"putdelta");
        if(TYPE((np-2)->val) != ARRAY)
                error("ARG TO PUTDELTA MUST BE AN ARRAY",FALSE);
 chek:  while(TYPE(np[-1].val) != INT)
                np[-1].val = error("ARRAY LENGTH MUST BE AN INTEGER",TRUE);
        if(np[-1].val->i <= 0)
                {
        if(TYPE((np-2)->val) != ARRAY)
                error("ARG TO PUTDELTA MUST BE AN ARRAY",FALSE);
 chek:  while(TYPE(np[-1].val) != INT)
                np[-1].val = error("ARRAY LENGTH MUST BE AN INTEGER",TRUE);
        if(np[-1].val->i <= 0)
                {
-               np[-1].val = error("ARRAY DELTA MUST BE POSITIVE",TRUE);
+               np[-1].val = error("Array delta must be positive",TRUE);
                goto chek;
                }
                goto chek;
                }
-       return((lbot)->val->delta = np[-1].val);
+       return((lbot)->val->ar.delta = np[-1].val);
        }
 
 lispval
 Lgetaux()
        {
        }
 
 lispval
 Lgetaux()
        {
-       chkarg(1);
+       chkarg(1,"getaux");
        if(TYPE(lbot->val)!=ARRAY)
        if(TYPE(lbot->val)!=ARRAY)
-               error("ARG TO GETAUX MUST BE ARRAY",FALSE);
-       return(lbot->val->aux);
+               error("Arg to getaux must be an array", FALSE);
+       return(lbot->val->ar.aux);
        }
 
 lispval
 Lputaux()
        {
        }
 
 lispval
 Lputaux()
        {
-       chkarg(2);
+       chkarg(2,"putaux");
 
        if(TYPE((lbot)->val)!=ARRAY)
 
        if(TYPE((lbot)->val)!=ARRAY)
-               error("1st ARG TO PUTAUX MUST BBE ARRAY",FALSE);
-       return((lbot)->val->aux = np[-1].val);
+               error("1st Arg to putaux must be array", FALSE);
+       return((lbot)->val->ar.aux = np[-1].val);
+       }
+
+lispval
+Lgetdata()
+       {
+       chkarg(1,"getdata");
+       if(TYPE(lbot->val)!=ARRAY)
+               error("Arg to getdata must be an array", FALSE);
+       return((lispval)lbot->val->ar.data);
+       }
+
+lispval
+Lputdata()
+       {
+       chkarg(2,"putdata");
+
+       if(TYPE((lbot)->val)!=ARRAY)
+               error("1st Arg to putaux must be array", FALSE);
+       return((lbot)->val->ar.data = (char *)np[-1].val);
        }
 
 lispval
 Lgeta()
        {
        }
 
 lispval
 Lgeta()
        {
-       chkarg(1);
+       chkarg(1,"getaccess");
        if(TYPE(lbot->val) != ARRAY)
                error("ARG TO GETACCESS MUST BE AN ARRAY",FALSE);
        if(TYPE(lbot->val) != ARRAY)
                error("ARG TO GETACCESS MUST BE AN ARRAY",FALSE);
-       return(lbot->val->accfun);
+       return(lbot->val->ar.accfun);
        }
 
 lispval
 Lputa()
        {
        }
 
 lispval
 Lputa()
        {
-       chkarg(2);
+       chkarg(2,"putaccess");
        if(TYPE((lbot)->val) != ARRAY)
                error("ARG TO PUTACCESS MUST BE ARRAY",FALSE);
        if(TYPE((lbot)->val) != ARRAY)
                error("ARG TO PUTACCESS MUST BE ARRAY",FALSE);
-       return((lbot)->val->accfun = np[-1].val);
+       return((lbot)->val->ar.accfun = np[-1].val);
        }
 
 lispval
        }
 
 lispval
@@ -180,96 +198,96 @@ Lmarray()
        register struct argent *mylbot = lbot;
        register lispval handy;
        snpand(2);
        register struct argent *mylbot = lbot;
        register lispval handy;
        snpand(2);
-       chkarg(5);
+       chkarg(5,"marray");
        (handy = newarray());           /*  get a new array cell  */
        (handy = newarray());           /*  get a new array cell  */
-       handy->data=(char *)mylbot->val;/*  insert data address  */
-       handy->accfun = mylbot[1].val;  /*  insert access function  */
-       handy->aux = mylbot[2].val;     /*  insert aux data  */
-       handy->length = mylbot[3].val;  /*  insert length  */
-       handy->delta = mylbot[4].val;   /*  push delta arg  */
+       handy->ar.data=(char *)mylbot->val;/*  insert data address  */
+       handy->ar.accfun = mylbot[1].val;       /*  insert access function  */
+       handy->ar.aux = mylbot[2].val;  /*  insert aux data  */
+       handy->ar.length = mylbot[3].val;       /*  insert length  */
+       handy->ar.delta = mylbot[4].val;        /*  push delta arg  */
        return(handy);
        }
 
 lispval
 Lgetentry()
        {
        return(handy);
        }
 
 lispval
 Lgetentry()
        {
-       chkarg(1);
+       chkarg(1,"getentry");
        if( TYPE(lbot->val) != BCD )
                error("ARG TO GETENTRY MUST BE FUNCTION",FALSE);
        if( TYPE(lbot->val) != BCD )
                error("ARG TO GETENTRY MUST BE FUNCTION",FALSE);
-       return((lispval)(lbot->val->entry));
+       return((lispval)(lbot->val->bcd.entry));
        }
 
 lispval
 Lgetlang()
        {
        }
 
 lispval
 Lgetlang()
        {
-       chkarg(1);
+       chkarg(1,"getlang");
        while(TYPE(lbot->val)!=BCD)
                lbot->val = error("ARG TO GETLANG MUST BE FUNCTION DESCRIPTOR",TRUE);
        while(TYPE(lbot->val)!=BCD)
                lbot->val = error("ARG TO GETLANG MUST BE FUNCTION DESCRIPTOR",TRUE);
-       return(lbot->val->language);
+       return(lbot->val->bcd.language);
        }
 
 lispval
 Lputlang()
        {
        }
 
 lispval
 Lputlang()
        {
-       chkarg(2);
+       chkarg(2,"putlang");
        while(TYPE((lbot)->val)!=BCD)
                lbot->val = error("FIRST ARG TO PUTLANG MUST BE FUNCTION DESCRIPTOR",TRUE);
        while(TYPE((lbot)->val)!=BCD)
                lbot->val = error("FIRST ARG TO PUTLANG MUST BE FUNCTION DESCRIPTOR",TRUE);
-       (lbot)->val->language = np[-1].val;
+       (lbot)->val->bcd.language = np[-1].val;
        return(np[-1].val);
        }
 
 lispval
 Lgetparams()
        {
        return(np[-1].val);
        }
 
 lispval
 Lgetparams()
        {
-       chkarg(1);
+       chkarg(1,"getparams");
        if(TYPE(np[-1].val)!=BCD)
                error("ARG TO GETPARAMS MUST BE A FUNCTION DESCRIPTOR",FALSE);
        if(TYPE(np[-1].val)!=BCD)
                error("ARG TO GETPARAMS MUST BE A FUNCTION DESCRIPTOR",FALSE);
-       return(np[-1].val->params);
+       return(np[-1].val->bcd.params);
        }
 
 lispval
 Lputparams()
        {
        }
 
 lispval
 Lputparams()
        {
-       chkarg(2);
+       chkarg(2,"putparams");
        if(TYPE((lbot)->val)!=BCD)
                error("1st ARG TO PUTPARAMS MUST BE FUNCTION DESCRIPTOR",FALSE);
        if(TYPE((lbot)->val)!=BCD)
                error("1st ARG TO PUTPARAMS MUST BE FUNCTION DESCRIPTOR",FALSE);
-       return((lbot)->val->params = np[-1].val);
+       return((lbot)->val->bcd.params = np[-1].val);
        }
 
 lispval
 Lgetdisc()
        {
        }
 
 lispval
 Lgetdisc()
        {
-       chkarg(1);
+       chkarg(1,"getdisc");
        if(TYPE(np[-1].val) != BCD)
                error("ARGUMENT OF GETDISC MUST BE FUNCTION",FALSE);
        if(TYPE(np[-1].val) != BCD)
                error("ARGUMENT OF GETDISC MUST BE FUNCTION",FALSE);
-       return(np[-1].val->discipline);
+       return(np[-1].val->bcd.discipline);
        }
 
 lispval
 Lputdisc()
        {
        }
 
 lispval
 Lputdisc()
        {
-       chkarg(2);
+       chkarg(2,"putdisc");
        if(TYPE(np[-2].val) != BCD)
                error("ARGUMENT OF PUTDISC MUST BE FUNCTION",FALSE);
        if(TYPE(np[-2].val) != BCD)
                error("ARGUMENT OF PUTDISC MUST BE FUNCTION",FALSE);
-       return((np-2)->val->discipline  = np[-1].val);
+       return((np-2)->val->bcd.discipline  = np[-1].val);
        }
 
 lispval
 Lgetloc()
        {
        }
 
 lispval
 Lgetloc()
        {
-       chkarg(1);
+       chkarg(1,"getloc");
        if(TYPE(lbot->val)!=BCD)
                error("ARGUMENT TO GETLOC MUST BE FUNCTION",FALSE);
        if(TYPE(lbot->val)!=BCD)
                error("ARGUMENT TO GETLOC MUST BE FUNCTION",FALSE);
-       return(lbot->val->loctab);
+       return(lbot->val->bcd.loctab);
        }
 
 lispval
 Lputloc()
        {
        }
 
 lispval
 Lputloc()
        {
-       chkarg(2);
+       chkarg(2,"putloc");
        if(TYPE((lbot+1)->val)!=BCD);
                error("FIRST ARGUMENT TO PUTLOC MUST BE FUNCTION",FALSE);
        if(TYPE((lbot+1)->val)!=BCD);
                error("FIRST ARGUMENT TO PUTLOC MUST BE FUNCTION",FALSE);
-       (lbot)->val->loctab = (lbot+1)->val;
+       (lbot)->val->bcd.loctab = (lbot+1)->val;
        return((lbot+1)->val);
        }
 
        return((lbot+1)->val);
        }
 
@@ -277,10 +295,10 @@ lispval
 Lmfunction()
        {
        register lispval handy;
 Lmfunction()
        {
        register lispval handy;
-       chkarg(5);
+       chkarg(2,"mfunction");
        handy = (newfunct());   /*  get a new function cell  */
        handy = (newfunct());   /*  get a new function cell  */
-       handy->entry = (lispval (*)())((np-5)->val);    /* insert entry point */
-       handy->discipline = ((np-4)->val); /*  insert discipline  */
+       handy->bcd.entry = (lispval (*)())((np-5)->val);        /* insert entry point */
+       handy->bcd.discipline = ((np-4)->val); /*  insert discipline  */
 #ifdef ROWAN
        handy->language = (np-3)->val;  /*  insert language  */
        handy->params = ((np-2)->val);     /*  insert parameters  */
 #ifdef ROWAN
        handy->language = (np-3)->val;  /*  insert language  */
        handy->params = ((np-2)->val);     /*  insert parameters  */
@@ -298,14 +316,13 @@ Lreplace()
        {
        register lispval a1, a2;
        register int t;
        {
        register lispval a1, a2;
        register int t;
-       chkarg(2);
+       chkarg(2,"replace");
 
        if((t = TYPE(a1 = (lbot)->val)) != TYPE(a2 = np[-1].val))
                error("REPLACE ARGS MUST BE SAME TYPE",FALSE);
 
        switch( t )
                {
 
        if((t = TYPE(a1 = (lbot)->val)) != TYPE(a2 = np[-1].val))
                error("REPLACE ARGS MUST BE SAME TYPE",FALSE);
 
        switch( t )
                {
-       case ATOM:      error("REPLACE CANNOT STORE ATOMS",FALSE);
 
        case VALUE:     a1->l = a2->l;
                        return( a1 );
 
        case VALUE:     a1->l = a2->l;
                        return( a1 );
@@ -313,24 +330,26 @@ Lreplace()
        case INT:       a1->i = a2->i;
                        return( a1 );
 
        case INT:       a1->i = a2->i;
                        return( a1 );
 
-       case STRNG:     error("STORE CANNOT STORE STRINGS",FALSE);
 
 
-       case ARRAY:     a1->data = a2->data;
-                       a1->accfun = a2->accfun;
-                       a1->length = a2->length;
-                       a1->delta = a2->delta;
+       case ARRAY:     a1->ar.data = a2->ar.data;
+                       a1->ar.accfun = a2->ar.accfun;
+                       a1->ar.length = a2->ar.length;
+                       a1->ar.delta = a2->ar.delta;
                        return( a1 );
 
        case DOUB:      a1->r = a2->r;
                        return( a1 );
 
        case SDOT:
                        return( a1 );
 
        case DOUB:      a1->r = a2->r;
                        return( a1 );
 
        case SDOT:
-       case DTPR:      a1->car = a2->car;
-                       a1->cdr = a2->cdr;
+       case DTPR:      a1->d.car = a2->d.car;
+                       a1->d.cdr = a2->d.cdr;
                        return( a1 );
                        return( a1 );
-       case BCD:       a1->entry = a2->entry;
-                       a1->discipline = a2->discipline;
+       case BCD:       a1->bcd.entry = a2->bcd.entry;
+                       a1->bcd.discipline = a2->bcd.discipline;
                        return( a1 );
                        return( a1 );
+       default:
+                       errorh(Vermisc,"Replace: cannot handle the type of this arg",
+                                                nil,FALSE,0,a1);
                }
        /* NOT REACHED */
        }
                }
        /* NOT REACHED */
        }
@@ -340,7 +359,7 @@ Lreplace()
 lispval
 Lvaluep()
        {
 lispval
 Lvaluep()
        {
-       chkarg(1);
+       chkarg(1,"valuep");
        if( TYPE(lbot->val) == VALUE ) return(tatom); else return(nil);
        }
 
        if( TYPE(lbot->val) == VALUE ) return(tatom); else return(nil);
        }
 
@@ -350,13 +369,13 @@ lispval
 Lod()
        {
        int i;
 Lod()
        {
        int i;
-       chkarg(2);
+       chkarg(2,"od");
 
        while( TYPE(np[-1].val) != INT )
                np[-1].val = error("2nd ARG TO OD MUST BE INTEGER",TRUE);
 
        for( i = 0; i < np->val->i; ++i )
 
        while( TYPE(np[-1].val) != INT )
                np[-1].val = error("2nd ARG TO OD MUST BE INTEGER",TRUE);
 
        for( i = 0; i < np->val->i; ++i )
-               printf(copval(odform,CNIL)->pname,(int *)(np[-2].val)[i]);
+               printf(copval(odform,CNIL)->a.pname,((int *)(np[-2].val))[i]);
 
        dmpport(poport);
        return(nil);
 
        dmpport(poport);
        return(nil);
@@ -364,7 +383,7 @@ Lod()
 lispval
 Lfake()
        {
 lispval
 Lfake()
        {
-       chkarg(1);
+       chkarg(1,"fake");
 
        if( TYPE(lbot->val) != INT )
                error("ARG TO FAKE MUST BE INTEGER",TRUE);
 
        if( TYPE(lbot->val) != INT )
                error("ARG TO FAKE MUST BE INTEGER",TRUE);
@@ -372,26 +391,29 @@ Lfake()
        return((lispval)(lbot->val->i));
        }
 
        return((lispval)(lbot->val->i));
        }
 
+       /* this used to be Lwhat, but was changed to Lmaknum for maclisp
+          compatiblity
+       */
 lispval
 lispval
-Lwhat()
+Lmaknum()
        {
        {
-       chkarg(1);
+       chkarg(1,"maknum");
        return(inewint((int)(lbot->val)));
        }
 
 lispval
 Lpname()
        {
        return(inewint((int)(lbot->val)));
        }
 
 lispval
 Lpname()
        {
-       chkarg(1);
+       chkarg(1,"pname");
        if(TYPE(lbot->val) != ATOM)
                error("ARG TO PNAME MUST BE AN ATOM",FALSE);
        if(TYPE(lbot->val) != ATOM)
                error("ARG TO PNAME MUST BE AN ATOM",FALSE);
-       return((lispval)(lbot->val->pname));
+       return((lispval)(lbot->val->a.pname));
        }
 
 lispval
 Larrayref()
        {
        }
 
 lispval
 Larrayref()
        {
-       chkarg(2);
+       chkarg(2,"arrayref");
        if(TYPE((lbot)->val) != ARRAY)
                error("FIRST ARG TO ARRAYREF MUST BE ARRAY",FALSE);
        vtemp = (lbot + 1)->val;
        if(TYPE((lbot)->val) != ARRAY)
                error("FIRST ARG TO ARRAYREF MUST BE ARRAY",FALSE);
        vtemp = (lbot + 1)->val;
@@ -402,12 +424,12 @@ chek:     while(TYPE(vtemp) != INT)
                vtemp = error("NEGATIVE ARRAY OFFSET",TRUE);
                goto chek;
                }
                vtemp = error("NEGATIVE ARRAY OFFSET",TRUE);
                goto chek;
                }
-       if( vtemp->i >= (np-2)->val->length->i )
+       if( vtemp->i >= (np-2)->val->ar.length->i )
                {
                vtemp = error("ARRAY OFFSET TOO LARGE",TRUE);
                goto chek;
                }
                {
                vtemp = error("ARRAY OFFSET TOO LARGE",TRUE);
                goto chek;
                }
-       vtemp = (lispval)((np-2)->val->data + ((np-2)->val->delta->i)*(vtemp->i));
+       vtemp = (lispval)((np-2)->val->ar.data + ((np-2)->val->ar.delta->i)*(vtemp->i));
                /*  compute address of desired item  */
        return(vtemp);
                        
                /*  compute address of desired item  */
        return(vtemp);
                        
@@ -416,15 +438,15 @@ chek:     while(TYPE(vtemp) != INT)
 lispval
 Lptr()
        {
 lispval
 Lptr()
        {
-       chkarg(1);
+       chkarg(1,"ptr");
        return(inewval(lbot->val));
        }
 
 lispval
 Llctrace()
        {
        return(inewval(lbot->val));
        }
 
 lispval
 Llctrace()
        {
-       chkarg(1);
-       lctrace = (int)(lbot->val->clb);
+       chkarg(1,"lctrace");
+       lctrace = (int)(lbot->val->a.clb);
        return((lispval)lctrace);
        }
 
        return((lispval)lctrace);
        }
 
@@ -440,9 +462,9 @@ Lsimpld()
        register lispval pt;
        register char *cpt = strbuf;
 
        register lispval pt;
        register char *cpt = strbuf;
 
-       chkarg(1);
+       chkarg(1,"simpld");
 
 
-       for(atmlen=1, pt=np->val; NOTNIL(pt); ++atmlen, pt = pt->cdr);
+       for(atmlen=1, pt=np->val; NOTNIL(pt); ++atmlen, pt = pt->d.cdr);
 
        if( atmlen > STRBLEN )
                {
 
        if( atmlen > STRBLEN )
                {
@@ -450,7 +472,7 @@ Lsimpld()
                return((lispval)inewstr(""));
                }
 
                return((lispval)inewstr(""));
                }
 
-       for(pt=np->val; NOTNIL(pt); pt = pt->cdr) *(cpt++) = pt->car->i;
+       for(pt=np->val; NOTNIL(pt); pt = pt->d.cdr) *(cpt++) = pt->d.car->i;
        *cpt = 0;
 
        return((lispval)newstr());
        *cpt = 0;
 
        return((lispval)newstr());
@@ -479,4 +501,3 @@ Lopval()
        else vtemp = CNIL;
        return(copval(quant,vtemp));
 }
        else vtemp = CNIL;
        return(copval(quant,vtemp));
 }
-