```common lisp
;; vector-operations.lisp
;;
;; Copyright (c) 2012 Matt Novenstern <fisxoj@gmail.com>
;;
;; This code is free software; you can redistribute it and/or
;; modify it under the terms of the version 3 of
;; the GNU Affero General Public License as published by
;; the Free Software Foundation.
;;
;; This code is distributed in the hope that it will be useful,
;; but without any warranty; without even the implied warranty of
;; merchantability or fitness for a particular purpose. See the GNU
;; Affero General Public License for more details.
;;
;; Version 3 of the GNU Affero General Public License is in the file
;; LICENSE that was distributed with this file.
;; If it is not present, you can access it from
;; https://www.gnu.org/licenses/agpl.txt (until superseded by a newer
;; version) or write to the Free Software Foundation, Inc., 59 Temple Place,
;; Suite 330, Boston, MA 02111-1307 USA
;;

(in-package #:map)

(defmethod norm ((vec vector))
  (sqrt (loop for i across vec sum (* i i))))

(defun dot (a b)
  "Dot product of two vectors.  Returns a scalar."
  (assert (= (length a) (length b)))
  (reduce #'+ (map 'vector '* a b)))

(defun mean (vector)
  (/ (sum vector) (length vector)))

(defmethod sum ((vector vector))
  (loop for i across vector sum i))
```

Fix silly loop boundary conditions
user
```common lisp
;; vector-operations.lisp
;;
;; Copyright (c) 2012 Matt Novenstern <fisxoj@gmail.com>
;;
;; This code is free software; you can redistribute it and/or
;; modify it under the terms of the version 3 of
;; the GNU Affero General Public License as published by
;; the Free Software Foundation.
;;
;; This code is distributed in the hope that it will be useful,
;; but without any warranty; without even the implied warranty of
;; merchantability or fitness for a particular purpose. See the GNU
;; Affero General Public License for more details.
;;
;; Version 3 of the GNU Affero General Public License is in the file
;; LICENSE that was distributed with this file.
;; If it is not present, you can access it from
;; https://www.gnu.org/licenses/agpl.txt (until superseded by a newer
;; version) or write to the Free Software Foundation, Inc., 59 Temple Place,
;; Suite 330, Boston, MA 02111-1307 USA
;;

(in-package #:map)

(defmethod norm ((vec vector))
  (sqrt (loop for i across vec sum (* i i))))

(defun dot (a b)
  "Dot product of two vectors.  Returns a scalar."
  (assert (= (length a) (length b)))
  (reduce #'+ (map 'vector '* a b)))

(defun mean (vector)
  (/ (sum vector) (length vector)))

(defmethod sum ((vector vector))
  (loop for i across vector sum i))


(defun range (vector min max)
  (map 'vector (lambda (n) (+ (mod (- n min) (abs (- max min))) min)) vector))
```
assistant