David Towson (SECAD) <towson@Amsaa> (01/16/85)
Fellow CP/Mers - As several people have recently expressed interest in XLISP by David Betz, here is some XLISP news passed along to me by my colleague, Brint Cooper: -------------------------------------------------------------------------- From seismo!harvard!godot!mit-eddie!genrad!decvax!ittvax!sii!drd Article 89 of net.lang.lisp: I am posting this for David Betz who does not have a direct news connection. ========================================================================== XLISP USERS This document briefly describes my version 1.2 of XLISP. It has nothing in common with the previously released version 1.2 other than that it is a descendant of my original version 1.1. It will be available shortly from the PC-SIG, SIG/M and PC-BLUE user groups. It will be distributed in source form with machine readable documentation. Please don't ask to have the sources distributed on usenet. The entire distribution is over 200K bytes! David Betz ...!decvax!sii!has70!betz ========================================================================== XLISP: An Experimental Object Oriented Language Version 1.2 October 11, 1984 by David Betz 114 Davenport Ave. Manchester, NH 03103 (603) 625-4691 (home) (603) 623-3330 (work) XLISP is an experimental programming language combining some of the features of LISP with an object oriented extension capability. It was implemented to allow experimentation with object oriented programming on small computers. There are currently implementations running on the PDP-11 under RSX-11, RT-11, and UNIX V7, on the VAX-11 under VAX/VMS and Berkeley VAX/UNIX, on the Z-80 under CP/M-80, on the Z8000 under UNIX V7, and on the 8088/8086 under CP/M-86 or MS-DOS. A version is currently being developed for the 68000 under CP/M-68K. It is completely written in the programming language 'C' and is easily extended with user written built-in functions and classes. It is available in source form free of charge to non-commercial users. Prospective commercial users should contact the author for permission to use XLISP. Version 1.2 of XLISP differs from version 1.1 in several ways. It supports many more Lisp functions. Also, many version 1.1 functions have been renamed and/or changed slightly to follow traditional Lisp usage. One of the most frequently reported problems in version 1.1 resulted from many functions being named after their equivilent functions in the C language. This turned out to be confusing for people who were trying to learn XLISP using traditional LISP texts as references. Version 1.2 renames these functions to be compatible with more traditional dialects of LISP. A recommended text for learning LISP programming is the book "LISP" by Winston and Horn and published by Addison Wesley. The first edition of this book is based on MacLisp and the second edition is based on Common Lisp. Future versions of XLISP will migrate towards compatiblility with Common Lisp. <form-feed> Page 2 XLISP version 1.2 functions: Evaluator functions (eval <expr>) EVALUATE AN XLISP EXPRESSION (apply <fun> <args>) APPLY A FUNCTION TO A LIST OF ARGUMENTS (funcall <fun> <arg>...) CALL A FUNCTION WITH ARGUMENTS (quote <expr>) RETURN AN EXPRESSION UNEVALUATED Symbol functions (set <sym> <expr>) SET THE VALUE OF A SYMBOL (setq <sym> <expr>) SET THE VALUE OF A SYMBOL (defun <sym> <fargs> <expr>...) DEFINE A FUNCTION WITH EVALUATED ARGS (ndefun <sym> <fargs> <expr>...) DEFINE A FUNCTION WITH UNEVALUATED ARGS (gensym <tag>) GENERATE A SYMBOL (intern <sym>) INTERN A SYMBOL ON THE OBLIST (get <sym> <prop>) GET THE VALUE OF A PROPERTY (putprop <sym> <value> <prop>) PUT A PROPERTY ONTO A PROPERTY LIST (remprop <prop> <sym>) REMOVE A PROPERTY List functions (car <expr>) RETURN THE CAR OF A LIST NODE (cdr <expr>) RETURN THE CDR OF A LIST NODE (caar <expr>) == (car (car <expr>)) (cadr <expr>) == (car (cdr <expr>)) (cdar <expr>) == (cdr (car <expr>)) (cddr <expr>) == (cdr (cdr <expr>)) (cons <expr1> <expr2>) CONSTRUCT A NEW LIST NODE (list <expr>...) CREATE A LIST OF VALUES (append <expr>...) APPEND LISTS (reverse <expr>) REVERSE A LIST (last <list>) RETURN THE LAST LIST NODE OF A LIST (member <expr> <list>) FIND AN EXPRESSION IN A LIST (memq <expr> <list>) FIND AN EXPRESSION IN A LIST (assoc <expr> <alist>) FIND AN EXPRESSION IN AN ASSOCIATION LIST (assq <expr> <alist>) FIND AN EXPRESSION IN AN ASSOCIATION LIST (length <expr>) FIND THE LENGTH OF A LIST (nth <n> <list>) RETURN THE NTH ELEMENT OF A LIST (nthcdr <n> <list>) RETURN THE NTH CDR OF A LIST (mapcar <fcn> <list1>...<listn>) APPLY FUNCTION TO SUCCESSIVE CARS (maplist <fcn> <list1>...<listn>) APPLY FUNCTION TO SUCCESSIVE CDRS (subst <to> <from> <expr>) SUBSTITUTE ONE EXPRESSION FOR ANOTHER (sublis <alist> <expr>) SUBSTITUTE USING AN ASSOCIATION LIST Destructive list functions (rplaca <list> <expr>) REPLACE THE CAR OF A LIST NODE (rplacd <list> <expr>) REPLACE THE CDR OF A LIST NODE (nconc <list>...) DESTRUCTIVELY CONCATENATE LISTS (delete <expr> <list>) DELETE OCCURANCES OF AN EXPRESSION FROM A LIST (delq <expr> <list>) DELETE OCCURANCES OF AN EXPRESSION FROM A LIST <form-feed> Page 3 Predicate functions (atom <expr>) IS THIS AN ATOM? (symbolp <expr>) IS THIS A SYMBOL? (numberp <expr>) IS THIS A NUMBER? (null <expr>) IS THIS AN EMPTY LIST? (not <expr>) IS THIS FALSE? (listp <expr>) IS THIS A LIST? (consp <expr>) IS THIS A NON-EMPTY LIST? (boundp <sym>) IS THIS A BOUND SYMBOL? (eq <expr1> <expr2>) ARE THE EXPRESSIONS IDENTICAL? (equal <expr1> <expr2>) ARE THE EXPRESSIONS EQUAL? Control functions (cond <pair>...) EVALUATE CONDITIONALLY (let (<binding>...) <expr>...) BIND SYMBOLS AND EVALUATE EXPRESSIONS (and <expr>...) THE LOGICAL AND OF A LIST OF EXPRESSIONS (or <expr>...) THE LOGICAL OR OF A LIST OF EXPRESSIONS (if <texpr> <expr1> [<expr2>]) EXECUTE EXPRESSIONS CONDITIONALLY (progn <expr>...) EXECUTE EXPRESSIONS SEQUENTIALLY (while <texpr> <expr>...) ITERATE WHILE AN EXPRESSION IS TRUE (repeat <iexpr> <expr>...) ITERATE USING A REPEAT COUNT Arithmetic functions (+ <expr>...) ADD A LIST OF NUMBERS (- <expr>...) SUBTRACT A LIST OF NUMBERS (* <expr>...) MULTIPLY A LIST OF NUMBERS (/ <expr>...) DIVIDE A LIST OF NUMBERS (1+ <expr>) ADD ONE TO A NUMBER (1- <expr>) SUBTRACT ONE FROM A NUMBER (rem <expr>...) REMAINDER OF A LIST OF NUMBERS (minus <expr>) NEGATE A NUMBER (min <expr>...) THE SMALLEST OF A LIST OF NUMBERS (max <expr>...) THE LARGEST OF A LIST OF NUMBERS (abs <expr>) THE ABSOLUTE VALUE OF A NUMBER Bitwise boolean functions (& <expr>...) THE BITWISE AND OF A LIST OF NUMBERS (| <expr...) THE BITWISE OR OF A LIST OF NUMBERS (~ <expr>) THE BITWISE NOT OF A NUMBER Relational functions (< <e1> <e2>) TEST FOR LESS THAN (<= <e1> <e2>) TEST FOR LESS THAN OR EQUAL TO (= <e1> <e2>) TEST FOR EQUAL TO (/= <e1> <e2>) TEST FOR NOT EQUAL TO (>= <e1> <e2>) TEST FOR GREATER THAN OR EQUAL TO (> <e1> <e2>) TEST FOR GREATER THAN <form-feed> Page 4 String functions (strcat <expr>...) CONCATENATE STRINGS (strlen <expr>) COMPUTE THE LENGTH OF A STRING (substr <expr> <sexpr> [<lexpr>]) EXTRACT A SUBSTRING (ascii <expr>) NUMERIC VALUE OF CHARACTER (chr <expr>) CHARACTER EQUIVALENT OF ASCII VALUE (atoi <expr>) CONVERT AN ASCII STRING TO AN INTEGER (itoa <expr>) CONVERT AN INTEGER TO AN ASCII STRING I/O functions (read [<source> [<eof>]]) READ AN XLISP EXPRESSION (print <expr> [<sink>]) PRINT A LIST OF VALUES ON A NEW LINE (prin1 <expr> [<sink>]) PRINT A LIST OF VALUES (princ <expr> [<sink>]) PRINT A LIST OF VALUES WITHOUT QUOTING (terpri [<sink>]) TERMINATE THE CURRENT PRINT LINE (flatsize <expr>) LENGTH OF PRINTED REPRESENTATION USING PRIN1 (flatc <expr>) LENGTH OF PRINTED REPRESENTATION USING PRINC (explode <expr>) CHARACTERS IN PRINTED REPRESENTATION USING PRIN1 (explodec <expr>) CHARACTERS IN PRINTED REPRESENTATION USING PRINC (maknam <list>) BUILD AN UNINTERNED SYMBOL FROM A LIST OF CHARACTERS (implode <list>) BUILD AN INTERNED SYMBOL FROM A LIST OF CHARACTERS (openi <fname>) OPEN AN INPUT FILE (openo <fname>) OPEN AN OUTPUT FILE (close <fp>) CLOSE A FILE (tyi [<source>]) GET A CHARACTER FROM A FILE OR STREAM (tyipeek [<source>]) PEEK AT THE NEXT CHARACTER FROM A FILE OR STREAM (tyo <ch> [<sink>]) PUT A CHARACTER TO A FILE OR STREAM (readline [<source>]) READ A LINE FROM A FILE OR STREAM System functions (load <fname>) LOAD AN XLISP SOURCE FILE (gc) FORCE GARBAGE COLLECTION (expand <num>) EXPAND MEMORY BY ADDING SEGMENTS (alloc <num>) CHANGE NUMBER OF NODES TO ALLOCATE IN EACH SEGMENT (mem) SHOW MEMORY ALLOCATION STATISTICS (type <expr>) RETURNS THE TYPE OF THE EXPRESSION (exit) EXIT XLISP
betz%Ucb-Vax@has70.UUCP (02/04/85)
XLISP USERS This document briefly describes my version 1.2 of XLISP. It has nothing in common with the previously released version 1.2 other than that it is a descendant of my original version 1.1. It will be available shortly from the PC-SIG, SIG/M and PC-BLUE user groups. It will be distributed in source form with machine readable documentation. Please don't ask to have the sources distributed on usenet. The entire distribution is over 200K bytes! David Betz ...!decvax!sii!has70!betz ========================================================================== XLISP: An Experimental Object Oriented Language Version 1.2 October 11, 1984 by David Betz 114 Davenport Ave. Manchester, NH 03103 (603) 625-4691 (home) (603) 623-3330 (work) XLISP is an experimental programming language combining some of the features of LISP with an object oriented extension capability. It was implemented to allow experimentation with object oriented programming on small computers. There are currently implementations running on the PDP-11 under RSX-11, RT-11, and UNIX V7, on the VAX-11 under VAX/VMS and Berkeley VAX/UNIX, on the Z-80 under CP/M-80, on the Z8000 under UNIX V7, and on the 8088/8086 under CP/M-86 or MS-DOS. A version is currently being developed for the 68000 under CP/M-68K. It is completely written in the programming language 'C' and is easily extended with user written built-in functions and classes. It is available in source form free of charge to non-commercial users. Prospective commercial users should contact the author for permission to use XLISP. Version 1.2 of XLISP differs from version 1.1 in several ways. It supports many more Lisp functions. Also, many version 1.1 functions have been renamed and/or changed slightly to follow traditional Lisp usage. One of the most frequently reported problems in version 1.1 resulted from many functions being named after their equivilent functions in the C language. This turned out to be confusing for people who were trying to learn XLISP using traditional LISP texts as references. Version 1.2 renames these functions to be compatible with more traditional dialects of LISP. A recommended text for learning LISP programming is the book "LISP" by Winston and Horn and published by Addison Wesley. The first edition of this book is based on MacLisp and the second edition is based on Common Lisp. Future versions of XLISP will migrate towards compatiblility with Common Lisp. <form-feed> Page 2 XLISP version 1.2 functions: Evaluator functions (eval <expr>) EVALUATE AN XLISP EXPRESSION (apply <fun> <args>) APPLY A FUNCTION TO A LIST OF ARGUMENTS (funcall <fun> <arg>...) CALL A FUNCTION WITH ARGUMENTS (quote <expr>) RETURN AN EXPRESSION UNEVALUATED Symbol functions (set <sym> <expr>) SET THE VALUE OF A SYMBOL (setq <sym> <expr>) SET THE VALUE OF A SYMBOL (defun <sym> <fargs> <expr>...) DEFINE A FUNCTION WITH EVALUATED ARGS (ndefun <sym> <fargs> <expr>...) DEFINE A FUNCTION WITH UNEVALUATED ARGS (gensym <tag>) GENERATE A SYMBOL (intern <sym>) INTERN A SYMBOL ON THE OBLIST (get <sym> <prop>) GET THE VALUE OF A PROPERTY (putprop <sym> <value> <prop>) PUT A PROPERTY ONTO A PROPERTY LIST (remprop <prop> <sym>) REMOVE A PROPERTY List functions (car <expr>) RETURN THE CAR OF A LIST NODE (cdr <expr>) RETURN THE CDR OF A LIST NODE (caar <expr>) == (car (car <expr>)) (cadr <expr>) == (car (cdr <expr>)) (cdar <expr>) == (cdr (car <expr>)) (cddr <expr>) == (cdr (cdr <expr>)) (cons <expr1> <expr2>) CONSTRUCT A NEW LIST NODE (list <expr>...) CREATE A LIST OF VALUES (append <expr>...) APPEND LISTS (reverse <expr>) REVERSE A LIST (last <list>) RETURN THE LAST LIST NODE OF A LIST (member <expr> <list>) FIND AN EXPRESSION IN A LIST (memq <expr> <list>) FIND AN EXPRESSION IN A LIST (assoc <expr> <alist>) FIND AN EXPRESSION IN AN ASSOCIATION LIST (assq <expr> <alist>) FIND AN EXPRESSION IN AN ASSOCIATION LIST (length <expr>) FIND THE LENGTH OF A LIST (nth <n> <list>) RETURN THE NTH ELEMENT OF A LIST (nthcdr <n> <list>) RETURN THE NTH CDR OF A LIST (mapcar <fcn> <list1>...<listn>) APPLY FUNCTION TO SUCCESSIVE CARS (maplist <fcn> <list1>...<listn>) APPLY FUNCTION TO SUCCESSIVE CDRS (subst <to> <from> <expr>) SUBSTITUTE ONE EXPRESSION FOR ANOTHER (sublis <alist> <expr>) SUBSTITUTE USING AN ASSOCIATION LIST Destructive list functions (rplaca <list> <expr>) REPLACE THE CAR OF A LIST NODE (rplacd <list> <expr>) REPLACE THE CDR OF A LIST NODE (nconc <list>...) DESTRUCTIVELY CONCATENATE LISTS (delete <expr> <list>) DELETE OCCURANCES OF AN EXPRESSION FROM A LIST (delq <expr> <list>) DELETE OCCURANCES OF AN EXPRESSION FROM A LIST <form-feed> Page 3 Predicate functions (atom <expr>) IS THIS AN ATOM? (symbolp <expr>) IS THIS A SYMBOL? (numberp <expr>) IS THIS A NUMBER? (null <expr>) IS THIS AN EMPTY LIST? (not <expr>) IS THIS FALSE? (listp <expr>) IS THIS A LIST? (consp <expr>) IS THIS A NON-EMPTY LIST? (boundp <sym>) IS THIS A BOUND SYMBOL? (eq <expr1> <expr2>) ARE THE EXPRESSIONS IDENTICAL? (equal <expr1> <expr2>) ARE THE EXPRESSIONS EQUAL? Control functions (cond <pair>...) EVALUATE CONDITIONALLY (let (<binding>...) <expr>...) BIND SYMBOLS AND EVALUATE EXPRESSIONS (and <expr>...) THE LOGICAL AND OF A LIST OF EXPRESSIONS (or <expr>...) THE LOGICAL OR OF A LIST OF EXPRESSIONS (if <texpr> <expr1> [<expr2>]) EXECUTE EXPRESSIONS CONDITIONALLY (progn <expr>...) EXECUTE EXPRESSIONS SEQUENTIALLY (while <texpr> <expr>...) ITERATE WHILE AN EXPRESSION IS TRUE (repeat <iexpr> <expr>...) ITERATE USING A REPEAT COUNT Arithmetic functions (+ <expr>...) ADD A LIST OF NUMBERS (- <expr>...) SUBTRACT A LIST OF NUMBERS (* <expr>...) MULTIPLY A LIST OF NUMBERS (/ <expr>...) DIVIDE A LIST OF NUMBERS (1+ <expr>) ADD ONE TO A NUMBER (1- <expr>) SUBTRACT ONE FROM A NUMBER (rem <expr>...) REMAINDER OF A LIST OF NUMBERS (minus <expr>) NEGATE A NUMBER (min <expr>...) THE SMALLEST OF A LIST OF NUMBERS (max <expr>...) THE LARGEST OF A LIST OF NUMBERS (abs <expr>) THE ABSOLUTE VALUE OF A NUMBER Bitwise boolean functions (& <expr>...) THE BITWISE AND OF A LIST OF NUMBERS (| <expr...) THE BITWISE OR OF A LIST OF NUMBERS (~ <expr>) THE BITWISE NOT OF A NUMBER Relational functions (< <e1> <e2>) TEST FOR LESS THAN (<= <e1> <e2>) TEST FOR LESS THAN OR EQUAL TO (= <e1> <e2>) TEST FOR EQUAL TO (/= <e1> <e2>) TEST FOR NOT EQUAL TO (>= <e1> <e2>) TEST FOR GREATER THAN OR EQUAL TO (> <e1> <e2>) TEST FOR GREATER THAN <form-feed> Page 4 String functions (strcat <expr>...) CONCATENATE STRINGS (strlen <expr>) COMPUTE THE LENGTH OF A STRING (substr <expr> <sexpr> [<lexpr>]) EXTRACT A SUBSTRING (ascii <expr>) NUMERIC VALUE OF CHARACTER (chr <expr>) CHARACTER EQUIVALENT OF ASCII VALUE (atoi <expr>) CONVERT AN ASCII STRING TO AN INTEGER (itoa <expr>) CONVERT AN INTEGER TO AN ASCII STRING I/O functions (read [<source> [<eof>]]) READ AN XLISP EXPRESSION (print <expr> [<sink>]) PRINT A LIST OF VALUES ON A NEW LINE (prin1 <expr> [<sink>]) PRINT A LIST OF VALUES (princ <expr> [<sink>]) PRINT A LIST OF VALUES WITHOUT QUOTING (terpri [<sink>]) TERMINATE THE CURRENT PRINT LINE (flatsize <expr>) LENGTH OF PRINTED REPRESENTATION USING PRIN1 (flatc <expr>) LENGTH OF PRINTED REPRESENTATION USING PRINC (explode <expr>) CHARACTERS IN PRINTED REPRESENTATION USING PRIN1 (explodec <expr>) CHARACTERS IN PRINTED REPRESENTATION USING PRINC (maknam <list>) BUILD AN UNINTERNED SYMBOL FROM A LIST OF CHARACTERS (implode <list>) BUILD AN INTERNED SYMBOL FROM A LIST OF CHARACTERS (openi <fname>) OPEN AN INPUT FILE (openo <fname>) OPEN AN OUTPUT FILE (close <fp>) CLOSE A FILE (tyi [<source>]) GET A CHARACTER FROM A FILE OR STREAM (tyipeek [<source>]) PEEK AT THE NEXT CHARACTER FROM A FILE OR STREAM (tyo <ch> [<sink>]) PUT A CHARACTER TO A FILE OR STREAM (readline [<source>]) READ A LINE FROM A FILE OR STREAM System functions (load <fname>) LOAD AN XLISP SOURCE FILE (gc) FORCE GARBAGE COLLECTION (expand <num>) EXPAND MEMORY BY ADDING SEGMENTS (alloc <num>) CHANGE NUMBER OF NODES TO ALLOCATE IN EACH SEGMENT (mem) SHOW MEMORY ALLOCATION STATISTICS (type <expr>) RETURNS THE TYPE OF THE EXPRESSION (exit) EXIT XLISP