aboutsummaryrefslogtreecommitdiff
path: root/ell.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-05-26 01:36:43 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-05-26 01:47:56 +0200
commitec7a0dc95f68f0a3b3a79d292596da26e3b8f467 (patch)
tree92e5d66bd97b66d0020f4e665b26c5e4ecf5302b /ell.c
parent735dfd026abaeee93c4e9b90db73661076ccafa3 (diff)
downloadell-ec7a0dc95f68f0a3b3a79d292596da26e3b8f467.tar.gz
ell-ec7a0dc95f68f0a3b3a79d292596da26e3b8f467.tar.xz
ell-ec7a0dc95f68f0a3b3a79d292596da26e3b8f467.zip
Add "values"
This oneliner is way too important to be left out.
Diffstat (limited to 'ell.c')
-rw-r--r--ell.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ell.c b/ell.c
index da3fb72..850083c 100644
--- a/ell.c
+++ b/ell.c
@@ -977,6 +977,10 @@ defn (fn_list) {
return check (ctx, (*result = new_list (values)));
}
+defn (fn_values) {
+ return !args || check (ctx, (*result = new_clone_list (args)));
+}
+
defn (fn_if) {
struct item *cond, *body, *keyword;
for (cond = args; ; cond = keyword->next) {
@@ -1280,6 +1284,7 @@ static bool
init_runtime_library (struct context *ctx) {
if (!native_register (ctx, "set", fn_set)
|| !native_register (ctx, "list", fn_list)
+ || !native_register (ctx, "values", fn_values)
|| !native_register (ctx, "if", fn_if)
|| !native_register (ctx, "map", fn_map)
|| !native_register (ctx, "print", fn_print)