-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #39: fix link when var is named multiple times in docstring
- Loading branch information
Showing
4 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Table of contents | ||
- [`user`](#user) | ||
- [`+and`](#user/+and) - Logical AND of heavy-bools which evaluates to a <code>heavy-bool</code>. | ||
- [`heavy-bool`](#user/heavy-bool) | ||
|
||
----- | ||
# <a name="user">user</a> | ||
|
||
|
||
|
||
|
||
|
||
|
||
## <a name="user/+and">`+and`</a><a name="user/+and"></a> | ||
``` clojure | ||
|
||
(+and & rest) | ||
``` | ||
Macro. | ||
|
||
Logical AND of heavy-bools which evaluates to a [`heavy-bool`](#user/heavy-bool). | ||
Expands to code which evaluates to the left-most [`heavy-bool`](#user/heavy-bool) value | ||
in the argument list, otherwise evaluates to the right-most | ||
value. If the argument list is empty, evaluates explicitly to | ||
`+true` | ||
<p><sub><a href="/blob/main/src/scratch.clj#L3-L18">Source</a></sub></p> | ||
|
||
## <a name="user/heavy-bool">`heavy-bool`</a><a name="user/heavy-bool"></a> | ||
``` clojure | ||
|
||
(heavy-bool) | ||
``` | ||
Function. | ||
<p><sub><a href="/blob/main/src/scratch.clj#L1-L1">Source</a></sub></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{:deps {io.github.borkdude/quickdoc {:local/root ".."}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(defn heavy-bool []) | ||
|
||
(defmacro +and | ||
"Logical AND of heavy-bools which evaluates to a `heavy-bool`. | ||
Expands to code which evaluates to the left-most `heavy-bool` value | ||
in the argument list, otherwise evaluates to the right-most | ||
value. If the argument list is empty, evaluates explicitly to | ||
`+true`" | ||
[& rest] | ||
(case (count rest) | ||
(0) true | ||
(1) (first rest) | ||
(let [v (gensym) | ||
[head & tail] rest] | ||
`(let [~v ~head] | ||
(+if ~v | ||
(+and ~@tail) | ||
~v))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters