Assignment 1, Due Monday, April 2, 2000
Submit assgn1.scm by hsp.
The file must contain at least your name and a comment before
each problem, indicating its number and other info you feel is required.
E.g.,
;;; assgn1.scm
;;; Your Name
;;; CS217 Assignment 1
;; 1. Ex 1.2.1, p17. Extension of list-of-numbers? that works
;; for an arbitrary scheme datum.
(define list-of-numbers?
(lambda (datum)
...))
...
- Ex 1.2.1, p17 Write
list-of-numbers?
that works when given an arbitrary Scheme dataum.
- Ex 1.2.2, p19. Write robust versions of
nth-elt
and list-length.
- Ex 1.2.11.1, p26.
(duple n x) => a list containing n copies of x
- Ex 1.2.11.2, p27
If lst is a list of lists of length 2,
(invert lst) => a list with each 2-list in lst
reversed.
- Ex 1.2.11.3, p27
(filter-in pred lst) => a list of members of lst
satisfying pred.
- Ex 1.2.11.4, p27
(exists? pred lst) => #t if any element of lst
satisfies pred, otherwise #f.
- Ex 1.2.11.5, p27
(vector-index pred v) => the zero based index of the
first element of v that satisfies pred.
- Optional: Ex 1.2.8, p23. Write
subst following the
original grammar with the Kleene star by using map.
assgn1.scm must be loadable into Scheme and procedures must pass tests
of correctness.