Remove get2 variant of get.
authorStas Boukarev <stassats@gmail.com>
Wed, 6 Nov 2013 00:46:26 +0000 (04:46 +0400)
committerStas Boukarev <stassats@gmail.com>
Wed, 6 Nov 2013 00:46:26 +0000 (04:46 +0400)
(get x y [z]) was expand into (get3 x y z) or (get2 x y), and get2
called (get3 x y nil), just expand into (get3 x y nil) directly.

src/code/symbol.lisp
src/compiler/fndb.lisp
src/compiler/srctran.lisp

index 5ef0d7b..978074e 100644 (file)
@@ -15,7 +15,7 @@
 
 (in-package "SB!IMPL")
 
 
 (in-package "SB!IMPL")
 
-(declaim (maybe-inline get get2 get3 %put getf remprop %putf get-properties keywordp))
+(declaim (maybe-inline get get3 %put getf remprop %putf get-properties keywordp))
 
 (defun symbol-value (symbol)
   #!+sb-doc
 
 (defun symbol-value (symbol)
   #!+sb-doc
@@ -123,20 +123,6 @@ distinct from the global value. Can also be SETF."
   is found, return the associated value, else return DEFAULT."
   (get3 symbol indicator default))
 
   is found, return the associated value, else return DEFAULT."
   (get3 symbol indicator default))
 
-(defun get2 (symbol indicator)
-  (get3 symbol indicator nil))
-#|
-  (let (cdr-pl)
-    (do ((pl (symbol-plist symbol) (cdr cdr-pl)))
-        ((atom pl) nil)
-      (setf cdr-pl (cdr pl))
-      (cond ((atom cdr-pl)
-             (error "~S has an odd number of items in its property list."
-                    symbol))
-            ((eq (car pl) indicator)
-             (return (car cdr-pl)))))))
-|#
-
 (defun get3 (symbol indicator default)
   (let (cdr-pl)
     (do ((pl (symbol-plist symbol) (cdr cdr-pl)))
 (defun get3 (symbol indicator default)
   (let (cdr-pl)
     (do ((pl (symbol-plist symbol) (cdr cdr-pl)))
index 4eacdfc..614dbae 100644 (file)
 ;;;; from the "Symbols" chapter:
 
 (defknown get (symbol t &optional t) t (flushable))
 ;;;; from the "Symbols" chapter:
 
 (defknown get (symbol t &optional t) t (flushable))
-(defknown sb!impl::get2 (symbol t) t (flushable))
 (defknown sb!impl::get3 (symbol t t) t (flushable))
 (defknown remprop (symbol t) t)
 (defknown symbol-plist (symbol) list (flushable))
 (defknown sb!impl::get3 (symbol t t) t (flushable))
 (defknown remprop (symbol t) t)
 (defknown symbol-plist (symbol) list (flushable))
 (defknown hash-table-p (t) boolean (movable foldable flushable))
 (defknown gethash (t hash-table &optional t) (values t boolean)
   (flushable)) ; not FOLDABLE, since hash table contents can change
 (defknown hash-table-p (t) boolean (movable foldable flushable))
 (defknown gethash (t hash-table &optional t) (values t boolean)
   (flushable)) ; not FOLDABLE, since hash table contents can change
-(defknown sb!impl::gethash2 (t hash-table) (values t boolean)
-  (flushable)) ; not FOLDABLE, since hash table contents can change
 (defknown sb!impl::gethash3 (t hash-table t) (values t boolean)
   (flushable)) ; not FOLDABLE, since hash table contents can change
 (defknown %puthash (t hash-table t) t ()
 (defknown sb!impl::gethash3 (t hash-table t) (values t boolean)
   (flushable)) ; not FOLDABLE, since hash table contents can change
 (defknown %puthash (t hash-table t) t ()
index b09518a..c808988 100644 (file)
    (t (values nil t))))
 (define-source-transform get (&rest args)
   (case (length args)
    (t (values nil t))))
 (define-source-transform get (&rest args)
   (case (length args)
-   (2 `(sb!impl::get2 ,@args))
+   (2 `(sb!impl::get3 ,@args nil))
    (3 `(sb!impl::get3 ,@args))
    (t (values nil t))))
 
    (3 `(sb!impl::get3 ,@args))
    (t (values nil t))))