You must turn in the answers to these questions both in hardcopy and by e-mail to echown@bowdoin.edu.
Demonstrate that your code works by including adequate examples, including all those presented here. There should not be an assignment form (setq or setf) anywhere in the functions you define.
> (setf x (cons (list 1 2) (list 3 4))) ((1 2) 3 4) >(fringe x) (1 2 3 4) >(fringe (list x x)) (1 2 3 4 1 2 3 4)
? (wheres-waldo '(ralph waldo emerson)) (FIRST (REST '(RALPH WALDO EMERSON))Note that if we evaluate this expression we get waldo,
? (first (rest '(ralph waldo emerson))) WALDOIn general, (eval (wheres-waldo x)) should return waldo if waldo is anywhere in x, and nil otherwise. Some more examples:
? (wheres-waldo '(mentor (ralph waldo emerson) (henry david thoreau))) (FIRST (REST (FIRST (REST '(MENTOR (RALPH WALDO EMERSON) (HENRY DAVID THOREAU)))))) ? (wheres-waldo '(henry david thoreau)) NIL ? (wheres-waldo '((lives-at (henry david thoreau) (walden pond)) (shops-at (john q tourist) (wall drug)) (shops-at (henry david thoreau) (wal mart)) (motivation (jane q 250 student) (will do)) (cooks-meat (henry david thoreau) (well done)) (visits (henry david thoreau) (home-of (wally waldo waldovsky))) (eats (mr ed) (wild oats)))) (FIRST (REST (FIRST (REST (FIRST (REST (REST (FIRST (REST . . .
? (wheres-target '(waldo emerson) '(ralph waldo emerson)) (REST '(RALPH WALDO EMERSON)) ? (wheres-target '(ralph waldo) '(ralph waldo emerson)) NIL ?(wheres-target '(whale dough) '(((waldo) (whale doe)) (((wale do) (wailed o (whale (dough)) whale dough))))) (REST (REST (REST (FIRST (REST (FIRST (FIRST (REST '(((WAL. . .