From a8b56704b52488f2865387d8cded8e5f13cdf919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Mon, 16 Jan 2023 00:30:57 -0300 Subject: Add alien call similar to what chezscheme has --- queue.lisp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'queue.lisp') diff --git a/queue.lisp b/queue.lisp index cc91eb8..c900731 100644 --- a/queue.lisp +++ b/queue.lisp @@ -1,6 +1,6 @@ (in-package #:queue) -(declaim (optimize (speed 3) (safety 0))) +(declaim (optimize (speed 3) (safety 1))) (defun new () (cons nil nil)) @@ -8,12 +8,9 @@ (defun add (q datum) (let ((element (cons datum nil))) (if (car q) - (progn - (setf (cddr q) element) - (setf (cdr q) (cddr q))) - (progn - (setf (car q) element) - (setf (cdr q) element))) + (setf (cddr q) element) + (setf (car q) element)) + (setf (cdr q) element) q)) (defun sub (q) -- cgit v1.2.3