File: util.lisp

package info (click to toggle)
ruby-unf-ext 0.0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,480 kB
  • sloc: cpp: 14,130; lisp: 1,180; ruby: 98; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 377 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(in-package :dict)

(declaim (inline acons!))

(defmacro a.if (exp then else)
  `(let ((it ,exp))
     (if it
         ,then
       ,else)))

(defun acons! (key value list &key test)
  (loop FOR x IN list
        WHEN (funcall test key (car x))
    DO (setf (cdr x) value)
       (return (values list nil))
    FINALLY
       (return (values `(,(cons key value) . ,list) t))))