CLISP is installed on the alpha's. You can invoke the clisp
interpreter by giving the command clisp
at the UNIX
prompt. To leave the clisp interpreter give the command
(quit)
. Other commands can be found in the on-line
manual.
FIRST, REST, CONS, COND,
NULL, LIST, LISTP, ATOM, EQ, EQUAL
etc.)
index
that has two arguments,
an item a
and a list of items ls
, and
returns the index of a
in ls
.
That is, the zero-based location of a
in
ls
. If the item is not in the list, the procedure
returns -1. For example:
- (index 3 '(1 2 3 4 5 6 7)) ==> 2
- (index 'so '(do re me fa so ka tu do)) ==> 4
- (index 'a '(b c d e)) ==> -1
length-it
that
computes the length of any given list.