summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-09-27 09:56:00 -0600
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-09-27 09:56:00 -0600
commit4584437d432a0fdd787f376273d948ca3f9fcea0 (patch)
treefb7996d030562cc4c47763899bd92c5bfc9575ab
parent1a8c81d07efe55c5a6909aff32359d4b8866af1c (diff)
downloadcmath-4584437d432a0fdd787f376273d948ca3f9fcea0.tar.gz
cmath-4584437d432a0fdd787f376273d948ca3f9fcea0.zip
these lambdas are unnecessary
-rw-r--r--src/vector/norm.lisp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/vector/norm.lisp b/src/vector/norm.lisp
index 2158296..aa51bce 100644
--- a/src/vector/norm.lisp
+++ b/src/vector/norm.lisp
@@ -3,8 +3,7 @@
(defun p-norm (p)
(lambda (v)
(expt
- (reduce (lambda (acc x)
- (+ acc x))
+ (reduce #'+
(mapcar (lambda (x)
(abs
(expt x p)))
@@ -12,6 +11,4 @@
(/ 1 p))))
(defun max-norm (v)
- (reduce (lambda (acc x)
- (max acc x))
- v))
+ (reduce #'max v))