diff options
author | Ben Burwell <bburwell1@gmail.com> | 2013-04-11 00:03:50 -0400 |
---|---|---|
committer | Ben Burwell <bburwell1@gmail.com> | 2013-04-11 00:03:50 -0400 |
commit | 5b05b64a2a658c0f7d4eb5b09fa342c7375a776e (patch) | |
tree | bad4537081da8b969084cff6880e36418f13a97d /HW02.rkt |
Init
Diffstat (limited to 'HW02.rkt')
-rw-r--r-- | HW02.rkt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/HW02.rkt b/HW02.rkt new file mode 100644 index 0000000..5e26219 --- /dev/null +++ b/HW02.rkt @@ -0,0 +1,35 @@ +#lang scheme + +;; invert +;; +;; takes a list of 2-lists and returns a list with each +;; 2-list reversed +(define + (invert list) + list +) + +;; vector-index +;; +;; returns the zero-based index of the first occurrence of +;; a parameter in a vector, or -1 if there is no occurrence +(define + (vector-index needle haystack) + haystack +) + +;; count-occurrences +;; +;; returns the number of occurrences of a parameter in a list +(define + (count-occurrences needle haystack) + haystack +) + +;; compose23 +;; +;; +(define + (compose23 a b c) + (a (b c)) +)
\ No newline at end of file |