aboutsummaryrefslogtreecommitdiff
path: root/HW02.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'HW02.rkt')
-rw-r--r--HW02.rkt35
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