1
0
mirror of https://github.com/janet-lang/janet synced 2025-07-05 19:42:55 +00:00

Merge pull request #153 from curist/docstring-fix

Update several docstrings.
This commit is contained in:
Calvin Rose 2019-08-05 10:20:11 -05:00 committed by GitHub
commit 40eff3e4a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -703,8 +703,7 @@
(if (= i nil) nil (get ind i))) (if (= i nil) nil (get ind i)))
(defn take-until (defn take-until
"Given a predicate, take only elements from an indexed type that satisfy "Same as (take-while (complement pred) ind)."
the predicate, and abort on first failure. Returns a new array."
[pred ind] [pred ind]
(def i (find-index pred ind)) (def i (find-index pred ind))
(if i (if i
@ -712,13 +711,13 @@
ind)) ind))
(defn take-while (defn take-while
"Same as (take-until (complement pred) ind)." "Given a predicate, take only elements from an indexed type that satisfy
the predicate, and abort on first failure. Returns a new array."
[pred ind] [pred ind]
(take-until (complement pred) ind)) (take-until (complement pred) ind))
(defn drop-until (defn drop-until
"Given a predicate, remove elements from an indexed type that satisfy "Same as (drop-while (complement pred) ind)."
the predicate, and abort on first failure. Returns a new array."
[pred ind] [pred ind]
(def i (find-index pred ind)) (def i (find-index pred ind))
(if i (if i
@ -726,7 +725,8 @@
@[])) @[]))
(defn drop-while (defn drop-while
"Same as (drop-until (complement pred) ind)." "Given a predicate, remove elements from an indexed type that satisfy
the predicate, and abort on first failure. Returns a new array."
[pred ind] [pred ind]
(drop-until (complement pred) ind)) (drop-until (complement pred) ind))