mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 19:19:53 +00:00
Merge pull request #429 from pepe/fix-reverse-doc
Tune reverse[d] docstrings
This commit is contained in:
commit
977b0c3c0c
@ -1215,7 +1215,8 @@
|
||||
res)
|
||||
|
||||
(defn reverse
|
||||
"Reverses the order of the elements in a given array or tuple and returns a new array."
|
||||
"Reverses the order of the elements in a given array or buffer and returns it
|
||||
mutated."
|
||||
[t]
|
||||
(def len-1 (- (length t) 1))
|
||||
(def half (/ len-1 2))
|
||||
@ -1228,7 +1229,8 @@
|
||||
t)
|
||||
|
||||
(defn reversed
|
||||
"Reverses the order of the elements in a given array or tuple and returns a new array."
|
||||
"Reverses the order of the elements in a given array or tuple and returns
|
||||
a new array. If string or buffer is provided function returns array of chars reversed."
|
||||
[t]
|
||||
(def len (length t))
|
||||
(var n (- len 1))
|
||||
|
Loading…
Reference in New Issue
Block a user