home *** CD-ROM | disk | FTP | other *** search
- diff -c ../xlisp.org/xlftab.c ../xlisp/xlftab.c
- *** ../xlisp.org/xlftab.c Sun May 7 22:25:54 1989
- --- ../xlisp/xlftab.c Wed Apr 5 16:18:28 1989
- ***************
- *** 11,17 ****
- rmhash(),rmquote(),rmdquote(),rmbquote(),rmcomma(),
- clnew(),clisnew(),clanswer(),
- obisnew(),obclass(),obshow(),
- ! rmlpar(),rmrpar(),rmsemi(),
- xeval(),xapply(),xfuncall(),xquote(),xfunction(),xbquote(),
- xlambda(),xset(),xsetq(),xsetf(),xdefun(),xdefmacro(),
- xgensym(),xmakesymbol(),xintern(),
- --- 11,17 ----
- rmhash(),rmquote(),rmdquote(),rmbquote(),rmcomma(),
- clnew(),clisnew(),clanswer(),
- obisnew(),obclass(),obshow(),
- ! rmlpar(),rmrpar(),rmlbrace(),rmrbrace(),rmsemi(),
- xeval(),xapply(),xfuncall(),xquote(),xfunction(),xbquote(),
- xlambda(),xset(),xsetq(),xsetf(),xdefun(),xdefmacro(),
- xgensym(),xmakesymbol(),xintern(),
- ***************
- *** 70,76 ****
- xcharp(),xcharint(),xintchar(),
- xmkstrinput(),xmkstroutput(),xgetstroutput(),xgetlstoutput(),
- xgetlambda(),xmacroexpand(),x1macroexpand(),
- ! xtrace(),xuntrace();
-
- /* functions specific to xldmem.c */
- LVAL xgc(),xexpand(),xalloc(),xmem();
- --- 70,76 ----
- xcharp(),xcharint(),xintchar(),
- xmkstrinput(),xmkstroutput(),xgetstroutput(),xgetlstoutput(),
- xgetlambda(),xmacroexpand(),x1macroexpand(),
- ! xtrace(),xuntrace(),xcopyarray();
-
- /* functions specific to xldmem.c */
- LVAL xgc(),xexpand(),xalloc(),xmem();
- ***************
- *** 90,96 ****
-
- /* the function table */
- FUNDEF funtab[] = {
- -
- /* read macro functions */
- { NULL, S, rmhash }, /* 0 */
- { NULL, S, rmquote }, /* 1 */
- --- 90,95 ----
- ***************
- *** 100,107 ****
- { NULL, S, rmlpar }, /* 5 */
- { NULL, S, rmrpar }, /* 6 */
- { NULL, S, rmsemi }, /* 7 */
- ! { NULL, S, xnotimp }, /* 8 */
- ! { NULL, S, xnotimp }, /* 9 */
-
- /* methods */
- { NULL, S, clnew }, /* 10 */
- --- 99,106 ----
- { NULL, S, rmlpar }, /* 5 */
- { NULL, S, rmrpar }, /* 6 */
- { NULL, S, rmsemi }, /* 7 */
- ! { NULL, S, rmlbrace }, /* 8 */
- ! { NULL, S, rmrbrace }, /* 9 */
-
- /* methods */
- { NULL, S, clnew }, /* 10 */
- ***************
- *** 426,432 ****
- { "SORT", S, xsort }, /* 284 */
-
- /* extra table entries */
- ! { NULL, S, xnotimp }, /* 285 */
- { NULL, S, xnotimp }, /* 286 */
- { NULL, S, xnotimp }, /* 287 */
- { NULL, S, xnotimp }, /* 288 */
- --- 425,431 ----
- { "SORT", S, xsort }, /* 284 */
-
- /* extra table entries */
- ! { "COPY-ARRAY", S, xcopyarray }, /* 285 */
- { NULL, S, xnotimp }, /* 286 */
- { NULL, S, xnotimp }, /* 287 */
- { NULL, S, xnotimp }, /* 288 */
- ***************
- *** 447,453 ****
-
- {0,0,0} /* end of table marker */
-
- ! };
-
- /* xnotimp - function table entries that are currently not implemented */
- LOCAL LVAL xnotimp()
- --- 446,452 ----
-
- {0,0,0} /* end of table marker */
-
- ! };
-
- /* xnotimp - function table entries that are currently not implemented */
- LOCAL LVAL xnotimp()
- diff -c ../xlisp.org/xlglob.c ../xlisp/xlglob.c
- *** ../xlisp.org/xlglob.c Sun May 7 22:25:55 1989
- --- ../xlisp/xlglob.c Wed Apr 5 16:18:28 1989
- ***************
- *** 22,27 ****
- --- 22,28 ----
- LVAL s_1plus=NIL,s_2plus=NIL,s_3plus=NIL;
- LVAL s_1star=NIL,s_2star=NIL,s_3star=NIL;
- LVAL s_minus=NIL,s_printcase=NIL;
- + LVAL s_send=NIL,s_sendsuper=NIL;
-
- /* keywords */
- LVAL k_test=NIL,k_tnot=NIL;
- diff -c ../xlisp.org/xlimage.c ../xlisp/xlimage.c
- *** ../xlisp.org/xlimage.c Sun May 7 22:25:57 1989
- --- ../xlisp/xlimage.c Wed Apr 5 16:18:28 1989
- ***************
- *** 22,28 ****
- /* external procedures */
- extern SEGMENT *newsegment();
- extern FILE *osbopen();
- ! extern char *malloc();
-
- /* forward declarations */
- OFFTYPE readptr();
- --- 22,28 ----
- /* external procedures */
- extern SEGMENT *newsegment();
- extern FILE *osbopen();
- ! extern char *xlmalloc();
-
- /* forward declarations */
- OFFTYPE readptr();
- ***************
- *** 170,176 ****
- case USTREAM:
- p = cviptr(off);
- p->n_type = type;
- - p->n_flags = 0;
- rplaca(p,cviptr(readptr()));
- rplacd(p,cviptr(readptr()));
- off += 2;
- --- 170,175 ----
- ***************
- *** 192,198 ****
- case VECTOR:
- case CLOSURE:
- max = getsize(p);
- ! if ((p->n_vdata = (LVAL *)malloc(max * sizeof(LVAL))) == NULL)
- xlfatal("insufficient memory - vector");
- total += (long)(max * sizeof(LVAL));
- for (i = 0; i < max; ++i)
- --- 191,197 ----
- case VECTOR:
- case CLOSURE:
- max = getsize(p);
- ! if ((p->n_vdata = (LVAL *)xlmalloc(max * sizeof(LVAL))) == NULL)
- xlfatal("insufficient memory - vector");
- total += (long)(max * sizeof(LVAL));
- for (i = 0; i < max; ++i)
- ***************
- *** 200,206 ****
- break;
- case STRING:
- max = getslength(p);
- ! if ((p->n_string = (unsigned char *)malloc(max)) == NULL)
- xlfatal("insufficient memory - string");
- total += (long)max;
- for (cp = getstring(p); --max >= 0; )
- --- 199,205 ----
- break;
- case STRING:
- max = getslength(p);
- ! if ((p->n_string = (unsigned char *)xlmalloc(max)) == NULL)
- xlfatal("insufficient memory - string");
- total += (long)max;
- for (cp = getstring(p); --max >= 0; )
- ***************
- *** 247,257 ****
- case VECTOR:
- case CLOSURE:
- if (p->n_vsize)
- ! free(p->n_vdata);
- break;
- case STRING:
- if (getslength(p))
- ! free(getstring(p));
- break;
- case STREAM:
- if ((fp = getfile(p)) && (fp != stdin && fp != stdout))
- --- 246,256 ----
- case VECTOR:
- case CLOSURE:
- if (p->n_vsize)
- ! xlfree(p->n_vdata);
- break;
- case STRING:
- if (getslength(p))
- ! xlfree(getstring(p));
- break;
- case STREAM:
- if ((fp = getfile(p)) && (fp != stdin && fp != stdout))
- ***************
- *** 259,265 ****
- break;
- }
- next = seg->sg_next;
- ! free(seg);
- }
- }
-
- --- 258,264 ----
- break;
- }
- next = seg->sg_next;
- ! xlfree(seg);
- }
- }
-
- ***************
- *** 302,308 ****
- char *p = (char *)&node->n_info;
- int n = sizeof(union ninfo);
- node->n_type = type;
- - node->n_flags = 0;
- while (--n >= 0)
- *p++ = osbgetc(fp);
- }
- --- 301,306 ----
- diff -c ../xlisp.org/xlinit.c ../xlisp/xlinit.c
- *** ../xlisp.org/xlinit.c Sun May 7 22:25:59 1989
- --- ../xlisp/xlinit.c Wed Apr 5 16:18:29 1989
- ***************
- *** 27,32 ****
- --- 27,33 ----
- extern LVAL a_fixnum,a_flonum,a_string,a_stream,a_object;
- extern LVAL a_vector,a_closure,a_char,a_ustream;
- extern LVAL s_gcflag,s_gchook;
- + extern LVAL s_send,s_sendsuper;
- extern FUNDEF funtab[];
-
- /* xlinit - xlisp initialization routine */
- ***************
- *** 106,111 ****
- --- 107,114 ----
- s_eql = xlenter("EQL");
- s_ifmt = xlenter("*INTEGER-FORMAT*");
- s_ffmt = xlenter("*FLOAT-FORMAT*");
- + s_send = xlenter("SEND");
- + s_sendsuper = xlenter("SEND-SUPER");
-
- /* symbols set by the read-eval-print loop */
- s_1plus = xlenter("+");
- diff -c ../xlisp.org/xlisp.c ../xlisp/xlisp.c
- *** ../xlisp.org/xlisp.c Sun May 7 22:26:02 1989
- --- ../xlisp/xlisp.c Thu Apr 6 10:06:46 1989
- ***************
- *** 6,12 ****
- #include "xlisp.h"
-
- /* define the banner line string */
- ! #define BANNER "XLISP version 2.0, Copyright (c) 1988, by David Betz"
-
- /* global variables */
- jmp_buf top_level;
- --- 6,12 ----
- #include "xlisp.h"
-
- /* define the banner line string */
- ! #define BANNER "XLISP version 2.0w, Copyright (c) 1988, by David Betz"
-
- /* global variables */
- jmp_buf top_level;
- ***************
- *** 52,60 ****
- }
- #endif
-
- /* initialize and print the banner line */
- osinit(BANNER);
- -
- /* setup initialization error handler */
- xlbegin(&cntxt,CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL,(LVAL)1);
- if (setjmp(cntxt.c_jmpbuf))
- --- 52,63 ----
- }
- #endif
-
- + #ifdef X11
- + parse_args(&argc,argv);
- + #endif
- +
- /* initialize and print the banner line */
- osinit(BANNER);
- /* setup initialization error handler */
- xlbegin(&cntxt,CF_TOPLEVEL|CF_CLEANUP|CF_BRKLEVEL,(LVAL)1);
- if (setjmp(cntxt.c_jmpbuf))
- ***************
- *** 61,67 ****
- xlfatal("fatal initialization error");
- if (setjmp(top_level))
- xlfatal("RESTORE not allowed during initialization");
- -
- /* initialize xlisp */
- xlinit();
- xlend(&cntxt);
- --- 64,69 ----
- diff -c ../xlisp.org/xlisp.h ../xlisp/xlisp.h
- *** ../xlisp.org/xlisp.h Sun May 7 22:26:12 1989
- --- ../xlisp/xlisp.h Wed Apr 5 16:23:51 1989
- ***************
- *** 4,10 ****
- Permission is granted for unrestricted non-commercial use */
-
- /* system specific definitions */
- ! /* #define UNIX */
-
- #include <stdio.h>
- #include <ctype.h>
- --- 4,11 ----
- Permission is granted for unrestricted non-commercial use */
-
- /* system specific definitions */
- ! #define X11
- ! /* #define ADEBUG */
-
- #include <stdio.h>
- #include <ctype.h>
- ***************
- *** 24,29 ****
- --- 25,35 ----
- /* OFFTYPE number the size of an address (int) */
-
- /* for the BSD 4.3 system. Might work for AT&T garbage */
- + #ifdef X11
- + #define UNIX
- + #define WINDOWS
- + #endif
- +
- #ifdef UNIX
- #define NNODES 2000
- #define SAVERESTORE
- ***************
- *** 82,87 ****
- --- 88,105 ----
- #define OFFTYPE long
- #endif
-
- + #ifdef MSW
- + #define NNODES 1000
- + #define AFMT "%lx"
- + #define OFFTYPE long
- + #define WINDOWS
- + #define VMEM
- + #define MSC
- + #define xlmalloc WMalloc
- + #define xlcalloc WCalloc
- + #define xlfree WFree
- + #endif
- +
- /* for the Mark Williams C compiler - Atari ST */
- #ifdef MWC
- #define AFMT "%lx"
- ***************
- *** 148,153 ****
- --- 166,176 ----
- #ifndef UCHAR
- #define UCHAR unsigned char
- #endif
- + #ifndef xlmalloc
- + #define xlmalloc malloc
- + #define xlcalloc calloc
- + #define xlfree free
- + #endif
-
- /* useful definitions */
- #define TRUE 1
- ***************
- *** 160,166 ****
- #include "xldmem.h"
-
- /* program limits */
- ! #define STRMAX 100 /* maximum length of a string constant */
- #define HSIZE 199 /* symbol hash table size */
- #define SAMPLE 100 /* control character sample rate */
-
- --- 183,189 ----
- #include "xldmem.h"
-
- /* program limits */
- ! #define STRMAX 512 /* maximum length of a string constant */
- #define HSIZE 199 /* symbol hash table size */
- #define SAMPLE 100 /* control character sample rate */
-
- ***************
- *** 173,178 ****
- --- 196,203 ----
- #define FT_RMLPAR 5
- #define FT_RMRPAR 6
- #define FT_RMSEMI 7
- + #define FT_RMLBRACE 8
- + #define FT_RMRBRACE 9
- #define FT_CLNEW 10
- #define FT_CLISNEW 11
- #define FT_CLANSWER 12
- ***************
- *** 179,191 ****
- #define FT_OBISNEW 13
- #define FT_OBCLASS 14
- #define FT_OBSHOW 15
- !
- /* macro to push a value onto the argument stack */
- #define pusharg(x) {if (xlsp >= xlargstktop) xlargstkoverflow();\
- ! *xlsp++ = (x);}
-
- /* macros to protect pointers */
- ! #define xlstkcheck(n) {if (xlstack - (n) < xlstkbase) xlstkoverflow();}
- #define xlsave(n) {*--xlstack = &n; n = NIL;}
- #define xlprotect(n) {*--xlstack = &n;}
-
- --- 204,216 ----
- #define FT_OBISNEW 13
- #define FT_OBCLASS 14
- #define FT_OBSHOW 15
- !
- /* macro to push a value onto the argument stack */
- #define pusharg(x) {if (xlsp >= xlargstktop) xlargstkoverflow();\
- ! *(xlsp++) = (x);}
-
- /* macros to protect pointers */
- ! #define xlstkcheck(n) {if ((xlstack - (n)) < xlstkbase) xlstkoverflow();}
- #define xlsave(n) {*--xlstack = &n; n = NIL;}
- #define xlprotect(n) {*--xlstack = &n;}
-
- ***************
- *** 230,235 ****
- --- 255,261 ----
- #define ustreamp(x) ((x) && ntype(x) == USTREAM)
- #define boundp(x) (getvalue(x) != s_unbound)
- #define fboundp(x) (getfunction(x) != s_unbound)
- + #define winobjp(x) ((x) && ntype(x) == WINOBJ)
-
- /* shorthand functions */
- #define consa(x) cons(x,NIL)
- ***************
- *** 323,326 ****
- /* error reporting functions (don't *really* return at all) */
- extern LVAL xltoofew(); /* report "too few arguments" error */
- extern LVAL xlbadtype(); /* report "bad argument type" error */
- -
- --- 349,351 ----
- diff -c ../xlisp.org/xlobj.c ../xlisp/xlobj.c
- *** ../xlisp.org/xlobj.c Sun May 7 22:26:20 1989
- --- ../xlisp/xlobj.c Wed Apr 5 16:18:40 1989
- ***************
- *** 41,47 ****
- /* xsendsuper - send a message to the superclass of an object */
- LVAL xsendsuper()
- {
- ! LVAL env,p;
- for (env = xlenv; env; env = cdr(env))
- if ((p = car(env)) && objectp(car(p)))
- return (sendmsg(car(p),
- --- 41,47 ----
- /* xsendsuper - send a message to the superclass of an object */
- LVAL xsendsuper()
- {
- ! register LVAL env,p;
- for (env = xlenv; env; env = cdr(env))
- if ((p = car(env)) && objectp(car(p)))
- return (sendmsg(car(p),
- ***************
- *** 97,104 ****
- int xlobgetvalue(pair,sym,pval)
- LVAL pair,sym,*pval;
- {
- ! LVAL cls,names;
- ! int ivtotal,n;
-
- /* find the instance or class variable */
- for (cls = cdr(pair); objectp(cls); cls = getivar(cls,SUPERCLASS)) {
- --- 97,104 ----
- int xlobgetvalue(pair,sym,pval)
- LVAL pair,sym,*pval;
- {
- ! register LVAL cls,names;
- ! register int ivtotal,n;
-
- /* find the instance or class variable */
- for (cls = cdr(pair); objectp(cls); cls = getivar(cls,SUPERCLASS)) {
- ***************
- *** 133,140 ****
- int xlobsetvalue(pair,sym,val)
- LVAL pair,sym,val;
- {
- ! LVAL cls,names;
- ! int ivtotal,n;
-
- /* find the instance or class variable */
- for (cls = cdr(pair); objectp(cls); cls = getivar(cls,SUPERCLASS)) {
- --- 133,140 ----
- int xlobsetvalue(pair,sym,val)
- LVAL pair,sym,val;
- {
- ! register LVAL cls,names;
- ! register int ivtotal,n;
-
- /* find the instance or class variable */
- for (cls = cdr(pair); objectp(cls); cls = getivar(cls,SUPERCLASS)) {
- ***************
- *** 309,315 ****
- LOCAL LVAL sendmsg(obj,cls,sym)
- LVAL obj,cls,sym;
- {
- ! LVAL msg,msgcls,method,val,p;
-
- /* look for the message in the class or superclasses */
- for (msgcls = cls; msgcls; ) {
- --- 309,316 ----
- LOCAL LVAL sendmsg(obj,cls,sym)
- LVAL obj,cls,sym;
- {
- ! LVAL method,val;
- ! register LVAL msg,msgcls,p;
-
- /* look for the message in the class or superclasses */
- for (msgcls = cls; msgcls; ) {
- ***************
- *** 316,322 ****
-
- /* lookup the message in this class */
- for (p = getivar(msgcls,MESSAGES); p; p = cdr(p))
- ! if ((msg = car(p)) && car(msg) == sym)
- goto send_message;
-
- /* look in class's superclass */
- --- 317,323 ----
-
- /* lookup the message in this class */
- for (p = getivar(msgcls,MESSAGES); p; p = cdr(p))
- ! if ((msg = car(p)) ? car(msg) == sym : 0)
- goto send_message;
-
- /* look in class's superclass */
- ***************
- *** 363,369 ****
- LOCAL LVAL evmethod(obj,msgcls,method)
- LVAL obj,msgcls,method;
- {
- ! LVAL oldenv,oldfenv,cptr,name,val;
- CONTEXT cntxt;
-
- /* protect some pointers */
- --- 364,370 ----
- LOCAL LVAL evmethod(obj,msgcls,method)
- LVAL obj,msgcls,method;
- {
- ! LVAL oldenv,oldfenv,name,cptr,val;
- CONTEXT cntxt;
-
- /* protect some pointers */
- ***************
- *** 420,428 ****
-
- /* listlength - find the length of a list */
- LOCAL int listlength(list)
- ! LVAL list;
- {
- ! int len;
- for (len = 0; consp(list); len++)
- list = cdr(list);
- return (len);
- --- 421,429 ----
-
- /* listlength - find the length of a list */
- LOCAL int listlength(list)
- ! register LVAL list;
- {
- ! register int len;
- for (len = 0; consp(list); len++)
- list = cdr(list);
- return (len);
- ***************
- *** 470,473 ****
- xladdmsg(object,":CLASS",FT_OBCLASS);
- xladdmsg(object,":SHOW",FT_OBSHOW);
- }
- -
- --- 471,473 ----
- diff -c ../xlisp.org/xlprin.c ../xlisp/xlprin.c
- *** ../xlisp.org/xlprin.c Sun May 7 22:26:23 1989
- --- ../xlisp/xlprin.c Fri May 5 13:35:51 1989
- ***************
- *** 33,38 ****
- --- 33,41 ----
- case FSUBR:
- putsubr(fptr,"FSubr",vptr);
- break;
- + case WINOBJ:
- + putsymbol(fptr,"<Windows object>",flag);
- + break;
- case CONS:
- xlputc(fptr,'(');
- for (nptr = vptr; nptr != NIL; nptr = next) {
- diff -c ../xlisp.org/xlread.c ../xlisp/xlread.c
- *** ../xlisp.org/xlread.c Sun May 7 22:26:26 1989
- --- ../xlisp/xlread.c Wed Apr 5 16:18:41 1989
- ***************
- *** 15,20 ****
- --- 15,21 ----
- extern LVAL s_quote,s_function,s_bquote,s_comma,s_comat;
- extern LVAL s_rtable,k_wspace,k_const,k_nmacro,k_tmacro;
- extern LVAL k_sescape,k_mescape;
- + extern LVAL s_send, s_sendsuper;
- extern char buf[];
-
- /* external routines */
- ***************
- *** 29,35 ****
- /* forward declarations */
- FORWARD LVAL callmacro();
- FORWARD LVAL psymbol(),punintern();
- ! FORWARD LVAL pnumber(),pquote(),plist(),pvector();
- FORWARD LVAL tentry();
-
- /* xlload - load a file of xlisp expressions */
- --- 30,36 ----
- /* forward declarations */
- FORWARD LVAL callmacro();
- FORWARD LVAL psymbol(),punintern();
- ! FORWARD LVAL pnumber(),pquote(),plist(),pmessage(),pvector();
- FORWARD LVAL tentry();
-
- /* xlload - load a file of xlisp expressions */
- ***************
- *** 366,371 ****
- --- 367,386 ----
- return (consa(plist(fptr)));
- }
-
- + /* rmlbrace - read macro for '{' */
- + LVAL rmlbrace()
- + {
- + LVAL fptr,mch;
- +
- + /* get the file and macro character */
- + fptr = xlgetfile();
- + mch = xlgachar();
- + xllastarg();
- +
- + /* make the return value */
- + return (consa(pmessage(fptr)));
- + }
- +
- /* rmrpar - read macro for ')' */
- LVAL rmrpar()
- {
- ***************
- *** 372,377 ****
- --- 387,398 ----
- xlfail("misplaced right paren");
- }
-
- + /* rmbrace - read macro for '}' */
- + LVAL rmrbrace()
- + {
- + xlfail("misplaced right brace");
- + }
- +
- /* rmsemi - read macro for ';' */
- LVAL rmsemi()
- {
- ***************
- *** 485,490 ****
- --- 506,555 ----
- return (val);
- }
-
- + /* plist - parse a message */
- + LOCAL LVAL pmessage(fptr)
- + LVAL fptr;
- + {
- + LVAL val,expr,lastnptr,nptr;
- + LVAL mess = s_send;
- +
- + /* protect some pointers */
- + xlstkcheck(2);
- + xlsave(val);
- + xlsave(expr);
- +
- + if (nextch(fptr) == '+') { /* Look for super class message */
- + mess = s_sendsuper;
- + xlgetc(fptr);
- + }
- +
- + /* keep appending nodes until a closing paren is found */
- + for (lastnptr = NIL; nextch(fptr) != '}'; )
- +
- + /* get the next expression */
- + if (readone(fptr,&expr) == EOF)
- + badeof(fptr);
- + else {
- + nptr = consa(expr);
- + if (lastnptr == NIL)
- + val = nptr;
- + else
- + rplacd(lastnptr,nptr);
- + lastnptr = nptr;
- + }
- +
- + /* skip the closing bracket */
- + xlgetc(fptr);
- +
- + val = cons(mess,val);
- +
- + /* restore the stack */
- + xlpopn(2);
- +
- + /* return successfully */
- + return (val);
- + }
- +
- /* pvector - parse a vector */
- LOCAL LVAL pvector(fptr)
- LVAL fptr;
- ***************
- *** 807,811 ****
- --- 872,878 ----
- defmacro('(', k_tmacro,FT_RMLPAR);
- defmacro(')', k_tmacro,FT_RMRPAR);
- defmacro(';', k_tmacro,FT_RMSEMI);
- + defmacro('{', k_tmacro,FT_RMLBRACE);
- + defmacro('}', k_tmacro,FT_RMRBRACE);
- }
-
- diff -c ../xlisp.org/xlsym.c ../xlisp/xlsym.c
- *** ../xlisp.org/xlsym.c Sun May 7 22:26:32 1989
- --- ../xlisp/xlsym.c Wed Apr 5 16:18:43 1989
- ***************
- *** 4,10 ****
- Permission is granted for unrestricted non-commercial use */
-
- #include "xlisp.h"
- !
- /* external variables */
- extern LVAL obarray,s_unbound;
- extern LVAL xlenv,xlfenv,xldenv;
- --- 4,11 ----
- Permission is granted for unrestricted non-commercial use */
-
- #include "xlisp.h"
- ! #undef HSIZE
- ! #define HSIZE 399
- /* external variables */
- extern LVAL obarray,s_unbound;
- extern LVAL xlenv,xlfenv,xldenv;
- ***************
- *** 16,22 ****
- LVAL xlenter(name)
- char *name;
- {
- ! LVAL sym,array;
- int i;
-
- /* check for nil */
- --- 17,24 ----
- LVAL xlenter(name)
- char *name;
- {
- ! register LVAL sym,array;
- ! LVAL sym2;
- int i;
-
- /* check for nil */
- ***************
- *** 31,44 ****
- return (car(sym));
-
- /* make a new symbol node and link it into the list */
- ! xlsave1(sym);
- ! sym = consd(getelement(array,i));
- ! rplaca(sym,xlmakesym(name));
- ! setelement(array,i,sym);
- xlpop();
- -
- /* return the new symbol */
- ! return (car(sym));
- }
-
- /* xlmakesym - make a new symbol node */
- --- 33,45 ----
- return (car(sym));
-
- /* make a new symbol node and link it into the list */
- ! xlsave1(sym2);
- ! sym2 = consd(getelement(array,i));
- ! rplaca(sym2,xlmakesym(name));
- ! setelement(array,i,sym2);
- xlpop();
- /* return the new symbol */
- ! return (car(sym2));
- }
-
- /* xlmakesym - make a new symbol node */
- ***************
- *** 68,74 ****
-
- /* xlxgetvalue - get the value of a symbol */
- LVAL xlxgetvalue(sym)
- ! LVAL sym;
- {
- register LVAL fp,ep;
- LVAL val;
- --- 69,75 ----
-
- /* xlxgetvalue - get the value of a symbol */
- LVAL xlxgetvalue(sym)
- ! register LVAL sym;
- {
- register LVAL fp,ep;
- LVAL val;
- ***************
- *** 95,101 ****
-
- /* xlsetvalue - set the value of a symbol */
- xlsetvalue(sym,val)
- ! LVAL sym,val;
- {
- register LVAL fp,ep;
-
- --- 96,103 ----
-
- /* xlsetvalue - set the value of a symbol */
- xlsetvalue(sym,val)
- ! register LVAL sym;
- ! LVAL val;
- {
- register LVAL fp,ep;
-
- ***************
- *** 137,143 ****
-
- /* xlxgetfunction - get the functional value of a symbol */
- LVAL xlxgetfunction(sym)
- ! LVAL sym;
- {
- register LVAL fp,ep;
-
- --- 139,145 ----
-
- /* xlxgetfunction - get the functional value of a symbol */
- LVAL xlxgetfunction(sym)
- ! register LVAL sym;
- {
- register LVAL fp,ep;
-
- ***************
- *** 192,198 ****
- xlremprop(sym,prp)
- LVAL sym,prp;
- {
- ! LVAL last,p;
- last = NIL;
- for (p = getplist(sym); consp(p) && consp(cdr(p)); p = cdr(last)) {
- if (car(p) == prp)
- --- 194,200 ----
- xlremprop(sym,prp)
- LVAL sym,prp;
- {
- ! register LVAL last,p;
- last = NIL;
- for (p = getplist(sym); consp(p) && consp(cdr(p)); p = cdr(last)) {
- if (car(p) == prp)
- ***************
- *** 208,214 ****
- LOCAL LVAL findprop(sym,prp)
- LVAL sym,prp;
- {
- ! LVAL p;
- for (p = getplist(sym); consp(p) && consp(cdr(p)); p = cdr(cdr(p)))
- if (car(p) == prp)
- return (cdr(p));
- --- 210,216 ----
- LOCAL LVAL findprop(sym,prp)
- LVAL sym,prp;
- {
- ! register LVAL p;
- for (p = getplist(sym); consp(p) && consp(cdr(p)); p = cdr(cdr(p)))
- if (car(p) == prp)
- return (cdr(p));
- ***************
- *** 217,226 ****
-
- /* hash - hash a symbol name string */
- int hash(str,len)
- ! char *str;
- {
- ! int i;
- ! for (i = 0; *str; )
- i = (i << 2) ^ *str++;
- i %= len;
- return (i < 0 ? -i : i);
- --- 219,228 ----
-
- /* hash - hash a symbol name string */
- int hash(str,len)
- ! register char *str;
- {
- ! register int i = 0;
- ! while (*str)
- i = (i << 2) ^ *str++;
- i %= len;
- return (i < 0 ? -i : i);
-
-
-
-