mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 19:19:53 +00:00
Merge pull request #1049 from harryvederci/patch-1
Improve documentation for the `all` function.
This commit is contained in:
commit
ce6bfb8420
@ -2065,8 +2065,9 @@
|
|||||||
ret)
|
ret)
|
||||||
|
|
||||||
(defn all
|
(defn all
|
||||||
``Returns true if all `xs` are truthy, otherwise the result of first
|
``Returns true if `(pred item)` returns a truthy value for every item in `xs`.
|
||||||
falsey predicate value, `(pred x)`.``
|
Otherwise, returns the first falsey `(pred item)` result encountered.
|
||||||
|
Returns true if `xs` is empty.``
|
||||||
[pred xs]
|
[pred xs]
|
||||||
(var ret true)
|
(var ret true)
|
||||||
(loop [x :in xs :while ret] (set ret (pred x)))
|
(loop [x :in xs :while ret] (set ret (pred x)))
|
||||||
|
Loading…
Reference in New Issue
Block a user