[plt-scheme] HtDP ex 11.2.4
Richard Cleis wrote:
> I unlearned everything that I knew about programming before starting
> through this book, and it hasn't yet revealed the likes of "list?" or
> "pair?" or "atom?". Is this problem solvable with only the now
> well-worn "empty?" ?
No, because "empty?" can only be applied to something which is "empty"
or "(cons ...)". But you also have "symbol?", which is sufficient.
Remember the design recipe: base cases, then recursive cases. You're
allowed to assume that the input is a deep-list. --PR