Merge pull request #1190 from pyx/docstring

Improve integer? and juxt docstrings
This commit is contained in:
Kodi Arfer 2016-12-27 09:05:48 -08:00 committed by GitHub
commit bc4d67891d
2 changed files with 4 additions and 3 deletions

View File

@ -73,3 +73,4 @@
* Kodi Arfer <git@arfer.net> * Kodi Arfer <git@arfer.net>
* Karan Sharma <karansharma1295@gmail.com> * Karan Sharma <karansharma1295@gmail.com>
* Sergey Sobko <s.sobko@profitware.ru> * Sergey Sobko <s.sobko@profitware.ru>
* Philip Xu <pyx@xrefactor.com>

View File

@ -266,7 +266,7 @@
(long-type x)) (long-type x))
(defn integer? [x] (defn integer? [x]
"Return True if x in an integer" "Return True if x is an integer"
(isinstance x (, int long-type))) (isinstance x (, int long-type)))
(defn integer-char? [x] (defn integer-char? [x]
@ -299,8 +299,8 @@
(isinstance x collections.Iterator)) (isinstance x collections.Iterator))
(defn juxt [f &rest fs] (defn juxt [f &rest fs]
"Return a function that apply a set of functions to same arguments and "Return a function that applies each of the supplied functions to a single
collect the result into a list." set of arguments and collects the results into a list."
(setv fs (cons f fs)) (setv fs (cons f fs))
(fn [&rest args &kwargs kwargs] (fn [&rest args &kwargs kwargs]
(list-comp (apply f args kwargs) [f fs]))) (list-comp (apply f args kwargs) [f fs])))