square that takes a number
and returns the square of the number.
> (square 1)
1
> (square 9)
81
member? that takes an atom
a and a list ls and returns #t if
a is in ls and #f otherwise.
> (member? (quote c) (quote (s c h e m e))) #t > (member? (quote basic) (quote (s c h e m e))) #f
duplicate that takes a number
n and an atom a and returns a list
containing only n occurrences of a.
> (duplicate 3 'foo) (foo foo foo) > (duplicate 0 'foo) ()
Chris Haynes / chaynes@indiana.edu