From 5d8fe8033f493c2df59f75ac862b725b8a244d78 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 5 Dec 2022 21:25:50 +0200 Subject: [collection] Improved how pop-back works --- src/collections.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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" -- cgit v1.2.3