summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Losh <steve@stevelosh.com>2016-08-20 21:51:28 +0000
committerSteve Losh <steve@stevelosh.com>2016-08-20 21:51:28 +0000
commit78dc5c4ba104c684b69f1d3f0d3c207e6d51e2b0 (patch)
treecff43ce25c5b87cb1c9c0c81dccff4e5ed05485e
parent2b7d5d60fd4f592f324d31129a63eb25dd49b0cb (diff)
Remove unused functionspaip
-rw-r--r--package.lisp5
-rw-r--r--src/utils.lisp45
-rw-r--r--src/wam/vm.lisp4
3 files changed, 2 insertions, 52 deletions
diff --git a/package.lisp b/package.lisp
index a8fd8a5..618baa0 100644
--- a/package.lisp
+++ b/package.lisp
@@ -4,15 +4,10 @@
#:cl-arrows
#:bones.quickutils)
(:export
- #:yolo
- #:repeat
- #:hex
#:push-if-new
- #:array-push
#:recursively
#:recur
#:when-let
- #:dis
#:megabytes
#:ecase/tree
#:gethash-or-init
diff --git a/src/utils.lisp b/src/utils.lisp
index 43aaaa3..4917f8e 100644
--- a/src/utils.lisp
+++ b/src/utils.lisp
@@ -29,34 +29,12 @@
:using (hash-value v)
:collect (list v k))))
-(defmacro repeat (n &body body)
- "Repeat `body` `n` times."
- `(dotimes (,(gensym) ,n)
- ,@body))
-
-(defun hex (d)
- (format nil "~X" d))
-
(defmacro when-let ((symbol value) &body body)
"Bind `value` to `symbol` and execute `body` if the value was not `nil`."
`(let ((,symbol ,value))
(when ,symbol ,@body)))
-(defmacro dis (arglist &body body)
- "Disassemble the code generated for a `lambda*` with `arglist` and `body`.
-
- It will also spew compiler notes so you can see why the garbage box isn't
- doing what you think it should be doing.
-
- "
- `(->> '(lambda* ,arglist
- (declare (optimize speed))
- ,@body)
- macroexpand-1
- (compile nil)
- disassemble))
-
(defmacro recursively (bindings &body body)
"Execute body recursively, like Clojure's `loop`/`recur`.
@@ -115,29 +93,6 @@
`(or (aref ,array ,index)
(setf (aref ,array ,index) ,default-form))))
-(defmacro array-push (value array pointer &environment env)
- "Push `value` onto `array` at `pointer`, incrementing `pointer` afterword.
-
- Returns the index the value was pushed to.
-
- "
- (multiple-value-bind (temp-vars temp-vals stores store access)
- (get-setf-expansion pointer env)
- (with-gensyms (address)
- `(let* (,@(mapcar #'list temp-vars temp-vals)
- (,address ,access)
- (,(car stores) (1+ ,address)))
- (setf (aref ,array ,address) ,value)
- ,store
- ,address))))
-
-(defmacro yolo (&body body)
- `(locally
- #+sbcl (declare (optimize (sb-c::insert-array-bounds-checks 0)
- (speed 3)
- (debug 0)
- (safety 0)))
- ,@body))
(defun megabytes (n)
"Return the number of 64-bit words in `n` megabytes."
diff --git a/src/wam/vm.lisp b/src/wam/vm.lisp
index 0f3bdce..08354eb 100644
--- a/src/wam/vm.lisp
+++ b/src/wam/vm.lisp
@@ -454,8 +454,8 @@
(define-instruction (%subterm-void) (wam n)
(ecase (wam-mode wam)
(:read (incf (wam-subterm wam) n))
- (:write (repeat n
- (push-unbound-reference! wam)))))
+ (:write (loop :repeat n
+ :do (push-unbound-reference! wam)))))
;;;; Control Instructions