Refactor things out into nice packages
author |
Steve Losh <steve@stevelosh.com> |
date |
Mon, 18 Apr 2016 22:58:22 +0000 |
parents |
dcf7b53a54df |
children |
2278039315fa |
(in-package #:coding-math.utils)
(defun dividesp (n divisor)
"Return whether `n` is evenly divisible by `divisor`."
(zerop (mod n divisor)))
(defmacro mulf (place n &environment env)
"Multiply `place` by `n` in-place."
(multiple-value-bind (temps exprs stores store-expr access-expr)
(get-setf-expansion place env)
`(let* (,@(mapcar #'list temps exprs)
(,(car stores) (* ,n ,access-expr)))
,store-expr)))