mirror of
https://github.com/janet-lang/janet
synced 2024-12-26 08:20:27 +00:00
Merge pull request #1252 from primo-ppcg/reverse
Rework `reverse`, again
This commit is contained in:
commit
79c12e5116
@ -1447,9 +1447,11 @@
|
|||||||
byte values, reversed.`
|
byte values, reversed.`
|
||||||
[t]
|
[t]
|
||||||
(var n (length t))
|
(var n (length t))
|
||||||
(def ret (array/new-filled n))
|
(def ret (if (bytes? t)
|
||||||
(forv i 0 n
|
(buffer/new-filled n)
|
||||||
(put ret i (in t (-- n))))
|
(array/new-filled n)))
|
||||||
|
(each v t
|
||||||
|
(put ret (-- n) v))
|
||||||
ret)
|
ret)
|
||||||
|
|
||||||
(defn invert
|
(defn invert
|
||||||
|
Loading…
Reference in New Issue
Block a user