From 5b05b64a2a658c0f7d4eb5b09fa342c7375a776e Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Thu, 11 Apr 2013 00:03:50 -0400 Subject: Init --- HW02.rkt | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 HW02.rkt (limited to 'HW02.rkt') 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 -- cgit v1.2.3