Some small doc fixes
This cleans up a number of doc warnings, including a bad underline for zero? While there, added a nil? function to match up with the new nil is None. Also un-hid myself from coreteam.
This commit is contained in:
parent
dfbdbdfb73
commit
032200bcb4
@ -67,7 +67,7 @@ release = hy.__version__
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build']
|
||||
exclude_patterns = ['_build', 'coreteam.rst']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
#default_role = None
|
||||
|
@ -19,17 +19,17 @@ Meet our mascot, "Cuddles":
|
||||
.. image:: http://fc07.deviantart.net/fs70/i/2013/138/f/0/cuddles_the_hacker_by_doctormo-d65l7lq.png
|
||||
:alt: Paul riding cuddles into the distance
|
||||
|
||||
|
||||
.. Our old ascii art mascot version
|
||||
.. Retained as an easter egg for those who read the docs via .rst!
|
||||
..
|
||||
.. LET'S CUDDLEFISH
|
||||
.. ______
|
||||
.. _.----'#' # '
|
||||
.. ,' #' ,# ;
|
||||
.. (' (w) _,-'_/
|
||||
.. /// / /'.____.'
|
||||
.. \|\||/
|
||||
Our old ascii art mascot version
|
||||
Retained as an easter egg for those who read the docs via .rst!
|
||||
|
||||
LET'S CUDDLEFISH
|
||||
______
|
||||
_.----'#' # '
|
||||
,' #' ,# ;
|
||||
(' (w) _,-'_/
|
||||
/// / /'.____.'
|
||||
\|\||/
|
||||
|
||||
|
||||
You can try Hy `in your browser <https://try-hy.appspot.com>`_.
|
||||
|
@ -242,6 +242,36 @@ Raises ``TypeError`` if ``(not (numeric? x))``.
|
||||
=> (neg? 0)
|
||||
False
|
||||
|
||||
|
||||
.. _nil?-fn:
|
||||
|
||||
nil?
|
||||
-----
|
||||
|
||||
Usage: ``(nil? x)``
|
||||
|
||||
Return True if x is nil/None.
|
||||
|
||||
.. code-block:: clojure
|
||||
|
||||
=> (nil? nil)
|
||||
True
|
||||
|
||||
=> (nil? None)
|
||||
True
|
||||
|
||||
=> (nil? 0)
|
||||
False
|
||||
|
||||
=> (setf x nil)
|
||||
=> (nil? x)
|
||||
True
|
||||
|
||||
=> ;; list.append always returns None
|
||||
=> (nil? (.append [1 2 3] 4))
|
||||
True
|
||||
|
||||
|
||||
.. _none?-fn:
|
||||
|
||||
none?
|
||||
@ -397,7 +427,7 @@ Return True if x is a string.
|
||||
.. _zero?-fn:
|
||||
|
||||
zero?
|
||||
----
|
||||
-----
|
||||
|
||||
Usage: ``(zero? x)``
|
||||
|
||||
|
@ -160,6 +160,10 @@
|
||||
"Return true if x is None"
|
||||
(is x None))
|
||||
|
||||
(defn nil? [x]
|
||||
"Return true if x is nil (None)"
|
||||
(is x None))
|
||||
|
||||
(defn numeric? [x]
|
||||
(import numbers)
|
||||
(instance? numbers.Number x))
|
||||
@ -253,5 +257,5 @@
|
||||
(def *exports* '[cycle dec distinct drop drop-while empty? even? filter flatten
|
||||
float? gensym
|
||||
inc instance? integer integer? iterable? iterate iterator? neg?
|
||||
none? nth numeric? odd? pos? remove repeat repeatedly second
|
||||
nil? none? nth numeric? odd? pos? remove repeat repeatedly second
|
||||
string string? take take-nth take-while zero?])
|
||||
|
@ -19,7 +19,6 @@ MISSING_NAMES = {
|
||||
# an owner of the organization.
|
||||
CONCEALED_MEMBERS = [
|
||||
('aldeka', 'Karen Rustad'),
|
||||
('rwtolbert', 'Bob Tolbert'),
|
||||
('tuturto', 'Tuukka Turto'),
|
||||
]
|
||||
|
||||
|
@ -293,6 +293,15 @@
|
||||
(assert-false (none? 0))
|
||||
(assert-false (none? "")))
|
||||
|
||||
(defn test-nil? []
|
||||
"NATIVE: testing for `is nil`"
|
||||
(assert-true (nil? nil))
|
||||
(assert-true (nil? None))
|
||||
(setv f nil)
|
||||
(assert-true (nil? f))
|
||||
(assert-false (nil? 0))
|
||||
(assert-false (nil? "")))
|
||||
|
||||
(defn test-nth []
|
||||
"NATIVE: testing the nth function"
|
||||
(assert-equal 2 (nth [1 2 4 7] 1))
|
||||
|
Loading…
Reference in New Issue
Block a user