Skip to content

Commit

Permalink
Work around a Sphinx-plugin bug in hy:macro
Browse files Browse the repository at this point in the history
If the name `else` is used here, no Intersphinx reference or HTML anchor is produced for this macro.
  • Loading branch information
Kodiologist committed Mar 27, 2024
1 parent f178095 commit e7de2e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ base names, such that ``hy.core.macros.foo`` can be called as just ``foo``.
=> (a-macro :b 3)
[:b 3]

.. hy:macro:: (if [test then else])
.. hy:macro:: (if [test true-value false-value])
``if`` compiles to an :py:keyword:`if` expression (or compound ``if`` statement). The form ``test`` is evaluated and categorized as true or false according to :py:class:`bool`. If the result is true, ``then`` is evaluated and returned. Othewise, ``else`` is evaluated and returned.
``if`` compiles to an :py:keyword:`if` expression (or compound ``if`` statement). The form ``test`` is evaluated and categorized as true or false according to :py:class:`bool`. If the result is true, ``true-value`` is evaluated and returned. Othewise, ``false-value`` is evaluated and returned.
::

(if (has-money-left account)
Expand Down

0 comments on commit e7de2e9

Please sign in to comment.