This assignment is the first that requires you to write recursive procedures in Scheme. The primary goal of this assignment is to gain experience with recursion and the Scheme primitive types, so you may not use the built-in procedures map, apply, list->vector, or vector->list within the body of any of your solutions. But I encourage you to explore other approaches to these problems -- that's a great way for you to master higher-order procedures and the other new ideas we are studying.
> (drop 2 '(a b c d e))
(c d e)
> (drop 25 (sequence 1 30))
(26 27 28 29 30)
> (drop 0 '(a b c d e))
(a b c d e)
> (drop 5 (sequence 1 5))
()
> (any? '(#t))
#t
> (any? '(#f))
#f
> (any? '(#f #f #f #t #f #f))
#t
> (any? '(#f #f #f #f))
#f
> (any? '())
#f
> (count 'a '(a b a c d a e f g a h i j k))
4
> (count 'a '(b c d e f g h i j k))
0
> (detect positive? '(1 -1 2 -2 3 -3 4 -4 -5))
1
> (detect boolean? (list 1 'a 't #t "false" #f '(a . b)))
#t
> (detect number? (list 'a 't #t '(1 2 3) "false" #f '(a . b)))
#f
> (detect pair? (list 'a 't #t '(1 2 3) "false" #f '(a . b)))
(1 2 3)
> (detect (lambda (x)
(not (number? x)))
(list 1 'a 't #t '(1 2 3) "false" #f '(a . b)))
a
> (detect (lambda (n)
(> n 1008))
(sequence 1000 1010))
1009
> (positions-of 'a '(a b a c d a e f g a h i j k))
(0 2 5 9)
> (positions-of 'a '(b c d e f g h i j k))
()
> (= (count 'a '(a b a c d a e))
(length (positions-of 'a '(a b a c d a e))))
#t
By the due time and date, submit the following files:
Be sure that your submission follows all homework submission requirements.