Changeset 1229
- Timestamp:
- 2015-06-11T14:19:03-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/utils.lisp
r1228 r1229 64 64 (declare (fixnum ,var)))))) 65 65 66 (defmacro summation (expr (var lo hi &optional (step 1) (addition '+))) 67 `(,addition ,@`(makelist ,expr ,var ,lo ,hi ,step))) 66 (defmacro summation (expr (var lo hi &optional (step 1)) &optional (addition '+) (initval 0)) 67 (let ((r (gensym))) 68 `(do ((,r ,initval) 69 (,var ,lo (+ ,var ,step))) 70 ((> ,var ,hi) ,r) 71 (setf ,r (,addition ,r ,expr))))) 68 72 69 73
Note:
See TracChangeset
for help on using the changeset viewer.