aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2022-12-05 21:25:50 +0200
committerSyndamia <kamen@syndamia.com>2022-12-05 21:25:50 +0200
commit5d8fe8033f493c2df59f75ac862b725b8a244d78 (patch)
tree1cb98547206880b5c106dfc46dbfed94ace3bf5d
parent71a75cd53090be3ec2704ad8d57d8a3b499a9c0c (diff)
downloadsenzill-5d8fe8033f493c2df59f75ac862b725b8a244d78.tar
senzill-5d8fe8033f493c2df59f75ac862b725b8a244d78.tar.gz
senzill-5d8fe8033f493c2df59f75ac862b725b8a244d78.zip
[collection] Improved how pop-back works
-rw-r--r--src/collections.lisp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/collections.lisp b/src/collections.lisp
index 4e7aae4..b0da74f 100644
--- a/src/collections.lisp
+++ b/src/collections.lisp
@@ -6,9 +6,9 @@
(defmacro pop-back (place)
"Removes destructively last element and returns it"
- `(progn (let ((val (car (last ,place))))
- (nbutlast ,place)
- val)))
+ `(let ((val (car (last ,place))))
+ (setq ,place (nbutlast ,place))
+ val))
(defun slice (place &key (begin 0) (end (length place)))
"Returns list of elements from begin to end indecies, inclusive"