home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / LANGUAGS / XLISP / XLISP12.ARK / XLFTAB.C < prev    next >
Text File  |  1985-02-19  |  5KB  |  178 lines

  1. /* xlftab.c - xlisp function table */
  2.  
  3. #ifdef AZTEC
  4. #include "stdio.h"
  5. #else
  6. #include <stdio.h>
  7. #endif
  8.  
  9. #include "xlisp.h"
  10.  
  11. /* external functions */
  12. extern struct node
  13.     *xeval(),*xapply(),*xfuncall(),*xquote(),
  14.     *xset(),*xsetq(),*xdefun(),*xndefun(),
  15.     *xgensym(),*xintern(),*xsymname(),*xsymplist(),
  16.     *xget(),*xputprop(),*xremprop(),
  17.     *xcar(),*xcaar(),*xcadr(),*xcdr(),*xcdar(),*xcddr(),
  18.     *xcons(),*xlist(),*xappend(),*xreverse(),*xlast(),*xnth(),*xnthcdr(),
  19.     *xmember(),*xmemq(),*xassoc(),*xassq(),*xsubst(),*xsublis(),*xlength(),
  20.     *xmapcar(),*xmaplist(),
  21.     *xrplca(),*xrplcd(),*xnconc(),*xdelete(),*xdelq(),
  22.     *xatom(),*xsymbolp(),*xnumberp(),*xboundp(),*xnull(),*xlistp(),*xconsp(),
  23.     *xeq(),*xequal(),
  24.     *xcond(),*xand(),*xor(),*xlet(),*xif(),*xprogn(),
  25.     *xwhile(),*xrepeat(),
  26.     *xadd(),*xsub(),*xmul(),*xdiv(),*xrem(),*xminus(),*xmin(),*xmax(),*xabs(),
  27.     *xadd1(),*xsub1(),*xbitand(),*xbitior(),*xbitxor(),*xbitnot(),
  28.     *xlss(),*xleq(),*xeql(),*xneq(),*xgeq(),*xgtr(),
  29.     *xstrlen(),*xstrcat(),*xsubstr(),*xascii(),*xchr(),*xatoi(),*xitoa(),
  30.     *xread(),*xprint(),*xprin1(),*xprinc(),*xterpri(),
  31.     *xflatsize(),*xflatc(),*xexplode(),*xexplc(),*ximplode(),*xmaknam(),
  32.     *xopeni(),*xopeno(),*xclose(),*xrdchar(),*xpkchar(),*xwrchar(),*xreadline(),
  33.     *xload(),*xgc(),*xexpand(),*xalloc(),*xmem(),*xtype(),*xexit();
  34.  
  35. struct fdef ftab[] = {
  36.  
  37.     /* evaluator functions */
  38.     "eval",        SUBR,    xeval,
  39.     "apply",    SUBR,    xapply,
  40.     "funcall",    SUBR,    xfuncall,
  41.     "quote",    FSUBR,    xquote,
  42.  
  43.     /* symbol functions */
  44.     "set",        SUBR,    xset,
  45.     "setq",        FSUBR,    xsetq,
  46.     "defun",    FSUBR,    xdefun,
  47.     "ndefun",    FSUBR,    xndefun,
  48.     "gensym",    SUBR,    xgensym,
  49.     "intern",    SUBR,    xintern,
  50.     "symbol-name",    SUBR,    xsymname,
  51.     "symbol-plist",    SUBR,    xsymplist,
  52.     "get",        SUBR,    xget,
  53.     "putprop",    SUBR,    xputprop,
  54.     "remprop",    SUBR,    xremprop,
  55.  
  56.     /* list functions */
  57.     "car",        SUBR,    xcar,
  58.     "caar",        SUBR,    xcaar,
  59.     "cadr",        SUBR,    xcadr,
  60.     "cdr",        SUBR,    xcdr,
  61.     "cdar",        SUBR,    xcdar,
  62.     "cddr",        SUBR,    xcddr,
  63.     "cons",        SUBR,    xcons,
  64.     "list",        SUBR,    xlist,
  65.     "append",    SUBR,    xappend,
  66.     "reverse",    SUBR,    xreverse,
  67.     "last",        SUBR,    xlast,
  68.     "nth",        SUBR,    xnth,
  69.     "nthcdr",    SUBR,    xnthcdr,
  70.     "member",    SUBR,    xmember,
  71.     "memq",        SUBR,    xmemq,
  72.     "assoc",    SUBR,    xassoc,
  73.     "assq",        SUBR,    xassq,
  74.     "subst",    SUBR,    xsubst,
  75.     "sublis",    SUBR,    xsublis,
  76.     "length",    SUBR,    xlength,
  77.     "mapcar",    SUBR,    xmapcar,
  78.     "maplist",    SUBR,    xmaplist,
  79.  
  80.     /* destructive list functions */
  81.     "rplaca",    SUBR,    xrplca,
  82.     "rplacd",    SUBR,    xrplcd,
  83.     "nconc",    SUBR,    xnconc,
  84.     "delete",    SUBR,    xdelete,
  85.     "delq",        SUBR,    xdelq,
  86.  
  87.     /* predicate functions */
  88.     "atom",        SUBR,    xatom,
  89.     "symbolp",    SUBR,    xsymbolp,
  90.     "numberp",    SUBR,    xnumberp,
  91.     "boundp",    SUBR,    xboundp,
  92.     "null",        SUBR,    xnull,
  93.     "not",        SUBR,    xnull,
  94.     "listp",    SUBR,    xlistp,
  95.     "consp",    SUBR,    xconsp,
  96.     "eq",        SUBR,    xeq,
  97.     "equal",    SUBR,    xequal,
  98.  
  99.     /* control functions */
  100.     "cond",        FSUBR,    xcond,
  101.     "and",        FSUBR,    xand,
  102.     "or",        FSUBR,    xor,
  103.     "let",        FSUBR,    xlet,
  104.     "if",        FSUBR,    xif,
  105.     "progn",    FSUBR,    xprogn,
  106.     "while",    FSUBR,    xwhile,
  107.     "repeat",    FSUBR,    xrepeat,
  108.  
  109.     /* arithmetic functions */
  110.     "+",        SUBR,    xadd,
  111.     "-",        SUBR,    xsub,
  112.     "*",        SUBR,    xmul,
  113.     "/",        SUBR,    xdiv,
  114.     "1+",        SUBR,    xadd1,
  115.     "1-",        SUBR,    xsub1,
  116.     "rem",        SUBR,    xrem,
  117.     "minus",    SUBR,    xminus,
  118.     "min",        SUBR,    xmin,
  119.     "max",        SUBR,    xmax,
  120.     "abs",        SUBR,    xabs,
  121.  
  122.     /* bitwise logical functions */
  123.     "bit-and",    SUBR,    xbitand,
  124.     "bit-ior",    SUBR,    xbitior,
  125.     "bit-xor",    SUBR,    xbitxor,
  126.     "bit-not",    SUBR,    xbitnot,
  127.  
  128.     /* numeric comparison functions */
  129.     "<",        SUBR,    xlss,
  130.     "<=",        SUBR,    xleq,
  131.     "=",        SUBR,    xeql,
  132.     "/=",        SUBR,    xneq,
  133.     ">=",        SUBR,    xgeq,
  134.     ">",        SUBR,    xgtr,
  135.  
  136.     /* string functions */
  137.     "strlen",    SUBR,    xstrlen,
  138.     "strcat",    SUBR,    xstrcat,
  139.     "substr",    SUBR,    xsubstr,
  140.     "ascii",    SUBR,    xascii,
  141.     "chr",        SUBR,    xchr,
  142.     "atoi",        SUBR,    xatoi,
  143.     "itoa",        SUBR,    xitoa,
  144.  
  145.     /* I/O functions */
  146.     "read",        SUBR,    xread,
  147.     "print",    SUBR,    xprint,
  148.     "prin1",    SUBR,    xprin1,
  149.     "princ",    SUBR,    xprinc,
  150.     "terpri",    SUBR,    xterpri,
  151.     "flatsize",    SUBR,    xflatsize,
  152.     "flatc",    SUBR,    xflatc,
  153.     "explode",    SUBR,    xexplode,
  154.     "explodec",    SUBR,    xexplc,
  155.     "implode",    SUBR,    ximplode,
  156.     "maknam",    SUBR,    xmaknam,
  157.  
  158.     /* file I/O functions */
  159.     "openi",    SUBR,    xopeni,
  160.     "openo",    SUBR,    xopeno,
  161.     "close",    SUBR,    xclose,
  162.     "read-char",    SUBR,    xrdchar,
  163.     "peek-char",    SUBR,    xpkchar,
  164.     "write-char",    SUBR,    xwrchar,
  165.     "readline",    SUBR,    xreadline,
  166.  
  167.     /* system functions */
  168.     "load",        SUBR,    xload,
  169.     "gc",        SUBR,    xgc,
  170.     "expand",    SUBR,    xexpand,
  171.     "alloc",    SUBR,    xalloc,
  172.     "mem",        SUBR,    xmem,
  173.     "type",        SUBR,    xtype,
  174.     "exit",        SUBR,    xexit,
  175.  
  176.     0
  177. };
  178.