# HG changeset patch # User Steve Losh # Date 1471895649 0 # Node ID 5b5e1b9adbbd262b7a69bb891359538557cde17e # Parent a1bc13ae51e7522ae67f2982df4b5fbd55627223 Remove `gethash-or-init`, it's already in Alexandria as `ensure-gethash` diff -r a1bc13ae51e7 -r 5b5e1b9adbbd losh.lisp --- a/losh.lisp Mon Aug 22 19:51:05 2016 +0000 +++ b/losh.lisp Mon Aug 22 19:54:09 2016 +0000 @@ -443,27 +443,6 @@ (defun-fmda single-float) -;;;; Hash Tables -(defmacro gethash-or-init (key hash-table default-form) - "Get `key`'s value in `hash-table`, initializing if necessary. - - If `key` is in `hash-table`: return its value without evaluating - `default-form` at all. - - If `key` is NOT in `hash-table`: evaluate `default-form` and insert it before - returning it. - - " - ;; TODO: think up a less shitty name for this - (once-only (key hash-table) - (with-gensyms (value found) - `(multiple-value-bind (,value ,found) - (gethash ,key ,hash-table) - (if ,found - ,value - (setf (gethash ,key ,hash-table) ,default-form)))))) - - ;;;; Queues ;;; Based on the PAIP queues (thanks, Norvig), but beefed up a little bit to add ;;; tracking of the queue size. diff -r a1bc13ae51e7 -r 5b5e1b9adbbd package.lisp --- a/package.lisp Mon Aug 22 19:51:05 2016 +0000 +++ b/package.lisp Mon Aug 22 19:54:09 2016 +0000 @@ -96,11 +96,6 @@ #:fill-multidimensional-array-fixnum #:fill-multidimensional-array-single-float)) -(defsubpackage #:losh.hash-tables - (:documentation "Utilities related to hash tables.") - (:export - #:gethash-or-init)) - (defsubpackage #:losh.queues (:documentation "A simple queue implementation.") (:export