mirror of
https://github.com/janet-lang/janet
synced 2025-07-27 14:22:57 +00:00
Merge branch 'master' of github.com:janet-lang/janet
This commit is contained in:
commit
7fb8c4a68d
@ -1215,7 +1215,8 @@
|
|||||||
res)
|
res)
|
||||||
|
|
||||||
(defn reverse
|
(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]
|
[t]
|
||||||
(def len-1 (- (length t) 1))
|
(def len-1 (- (length t) 1))
|
||||||
(def half (/ len-1 2))
|
(def half (/ len-1 2))
|
||||||
@ -1228,7 +1229,8 @@
|
|||||||
t)
|
t)
|
||||||
|
|
||||||
(defn reversed
|
(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]
|
[t]
|
||||||
(def len (length t))
|
(def len (length t))
|
||||||
(var n (- len 1))
|
(var n (- len 1))
|
||||||
|
@ -112,7 +112,7 @@ typedef struct {
|
|||||||
#endif
|
#endif
|
||||||
static JanetStream *make_stream(int fd, int flags) {
|
static JanetStream *make_stream(int fd, int flags) {
|
||||||
JanetStream *stream = janet_abstract(&StreamAT, sizeof(JanetStream));
|
JanetStream *stream = janet_abstract(&StreamAT, sizeof(JanetStream));
|
||||||
#ifndef SOCK_CLOEXEC
|
#if !defined(SOCK_CLOEXEC) && defined(O_CLOEXEC)
|
||||||
int extra = O_CLOEXEC;
|
int extra = O_CLOEXEC;
|
||||||
#else
|
#else
|
||||||
int extra = 0;
|
int extra = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user