From 6caf8d3d565a5191dbad4517989402e705c8f88b Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 3 Aug 2019 13:57:11 -0500 Subject: [PATCH] Make `comp` create variadic functions. --- src/boot/boot.janet | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/boot/boot.janet b/src/boot/boot.janet index 6b9be364..850fee2b 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -494,9 +494,9 @@ (case (length functions) 0 nil 1 (get functions 0) - 2 (let [[f g] functions] (fn [x] (f (g x)))) - 3 (let [[f g h] functions] (fn [x] (f (g (h x))))) - 4 (let [[f g h i] functions] (fn [x] (f (g (h (i x)))))) + 2 (let [[f g] functions] (fn [& x] (f (g ;x)))) + 3 (let [[f g h] functions] (fn [& x] (f (g (h ;x))))) + 4 (let [[f g h i] functions] (fn [& x] (f (g (h (i ;x)))))) (let [[f g h i j] functions] (comp (fn [x] (f (g (h (i (j x)))))) ;(tuple/slice functions 5 -1)))))