MIT Scheme is installed on
Burnsville which is located in 006. You can invoke the Scheme
interpreter by giving the command scheme
at the UNIX
prompt when logged on to Burnsville. To leave the Scheme interpreter
give the command (exit)
.
CAR, CDR, CONS, COND,
LIST, LIST?, 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.