SICP Exercise 2.17 last-pair

Exercise 2.17.  Define a procedure last-pair that returns the list that contains only the last element of a given (nonempty) list:




(last-pair (list 23 72 149 34))
(34)

SOLUTION

The code and tests are here.

Comments

Popular posts from this blog

SICP Exercise 2.56 differentiation rule

SICP Exercise 1.28 (Miller-Rabin Test)

SICP Exercise 4.18 a alternative strategy for interpreting internal definitions