Unformatted text preview: which the former first element becomes the last. Lisp-&gt; (rotate-left (a b c)) (b c a) Lisp-&gt; (rotate-left (rotate-left (a b c))) (c a b) 3.4 Define ROTATE-RIGHT which is like ROTATE-LEFT except in the pposite direction. You might want to use BUTLAST. 3.5 A palindrome is a list that has the same sequence of elements when read from right-to-left that it does from left-to-right. Define PALINDROME such that it takes a list as its argument and returns a plaindrome that is twice as long. 4.1 Define DIVISIBLE-BY-THREE, a predicate that determines if an integer is divisible by three. You may want to use REM. Lisp-&gt; (divisible-by-three 3) T Lisp-&gt; (divisible-by-three 4) Nil 4.5 Write IF forms that are equivalent to (ABS X), (MIN A B), and (MAX A B), where X, A,and B are numbers. 4.6 Compose COND forms that are equivalent to (NOT U), (OR X Y Z), and (AND A B C)....
View Full Document
- Fall '08
- Adam and Eve, Lisp, Program Flow sections, entire programming assignment