1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-24 06:03:17 +00:00

Remove min-order and max-order.

Also address #275 by exposing lflags and cflags
to declare-executable
This commit is contained in:
Calvin Rose 2020-01-24 17:35:21 -06:00
parent 689f2dcbb4
commit 9dad8bf56d
2 changed files with 7 additions and 14 deletions

View File

@ -753,10 +753,11 @@ int main(int argc, const char **argv) {
file is evaluated and a main function is looked for in the entry file. This function
is marshalled into bytecode which is then embedded in a final executable for distribution.\n\n
This executable can be installed as well to the --binpath given."
[&keys {:install install :name name :entry entry :headers headers}]
[&keys {:install install :name name :entry entry :headers headers
:cflags cflags :lflags lflags}]
(def name (if is-win (string name ".exe") name))
(def dest (string "build" sep name))
(create-executable @{} entry dest)
(create-executable @{:cflags cflags :lflags lflags} entry dest)
(add-dep "build" dest)
(when headers
(each h headers (add-dep dest h)))

View File

@ -588,16 +588,6 @@
"Returns the numeric minimum of the arguments."
[& args] (extreme < args))
(defn max-order
"Returns the maximum of the arguments according to a total
order over all values."
[& args] (extreme > args))
(defn min-order
"Returns the minimum of the arguments according to a total
order over all values."
[& args] (extreme < args))
(defn first
"Get the first element from an indexed data structure."
[xs]
@ -766,8 +756,9 @@
[n ind]
(def use-str (bytes? ind))
(def f (if use-str string/slice tuple/slice))
(def len (length ind))
# make sure end is in [0, len]
(def end (max 0 (min n (length ind))))
(def end (if (< n 0) n (if (> n len) len n)))
(f ind 0 end))
(defn take-until
@ -791,8 +782,9 @@
[n ind]
(def use-str (bytes? ind))
(def f (if use-str string/slice tuple/slice))
(def len (length ind))
# make sure start is in [0, len]
(def start (max 0 (min n (length ind))))
(def start (if (< n 0) n (if (> n len) len n)))
(f ind start -1))
(defn drop-until