Add source transforms to eliminate hairy arg processing in GETHASH.
such entry. Entries can be added using SETF."
(declare (type hash-table hash-table)
(values t (member t nil)))
+ (gethash3 key hash-table default))
+
+(defun gethash2 (key hash-table)
+ #!+sb-doc
+ "Two argument version of GETHASH"
+ (declare (type hash-table hash-table)
+ (values t (member t nil)))
+ (gethash3 key hash-table nil))
+
+(defun gethash3 (key hash-table default)
+ #!+sb-doc
+ "Three argument version of GETHASH"
+ (declare (type hash-table hash-table)
+ (values t (member t nil)))
(without-gcing
(cond ((= (get-header-data (hash-table-table hash-table))
sb!vm:vector-must-rehash-subtype)
(defknown hash-table-p (t) boolean (movable foldable flushable))
(defknown gethash (t hash-table &optional t) (values t boolean)
(flushable unsafe)) ; not FOLDABLE, since hash table contents can change
+(defknown sb!impl::gethash2 (t hash-table) (values t boolean)
+ (flushable unsafe)) ; not FOLDABLE, since hash table contents can change
+(defknown sb!impl::gethash3 (t hash-table t) (values t boolean)
+ (flushable unsafe)) ; not FOLDABLE, since hash table contents can change
(defknown %puthash (t hash-table t) t (unsafe))
(defknown remhash (t hash-table) boolean ())
(defknown maphash (callable hash-table) null (flushable call))
(define-source-transform nth (n l) `(car (nthcdr ,n ,l)))
(define-source-transform last (x) `(sb!impl::last1 ,x))
-;; (define-source-transform last (x)
-;; `(let* ((x (the list ,x))
-;; (r (cdr x)))
-;; (do () ((atom r) x)
-;; (shiftf x r (cdr r)))))
+(define-source-transform gethash (&rest args)
+ (case (length args)
+ (2 `(sb!impl::gethash2 ,@args))
+ (3 `(sb!impl::gethash3 ,@args))
+ (t (values nil t))))
(defvar *default-nthcdr-open-code-limit* 6)
(defvar *extreme-nthcdr-open-code-limit* 20)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.3.28"
+"0.9.3.29"