From cb4beecbbc4ab3ec918ab640ffb621036707678f Mon Sep 17 00:00:00 2001
From: Eduardo Julian
Date: Mon, 4 Feb 2019 19:38:19 -0400
Subject: Fixed a bug in how the "_$" macro works.

---
 stdlib/source/lux.lux | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'stdlib/source')

diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index 334632272..1a35b4ebd 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -1574,6 +1574,13 @@
            (form$ (list op a1 a2))}
           op))
 
+(def:''' (function/flip func)
+         #Nil
+         (All [a b c]
+           (-> (-> a b c) (-> b a c)))
+         (function' [right left]
+                    (func left right)))
+
 (macro:' #export (_$ tokens)
          (#Cons [(tag$ ["lux" "doc"])
                  (text$ ("lux text concat"
@@ -1586,7 +1593,7 @@
                 #Nil)
          ({(#Cons op tokens')
            ({(#Cons first nexts)
-             (return (list (list/fold (_$_joiner op) first nexts)))
+             (return (list (list/fold (function/flip (_$_joiner op)) first nexts)))
 
              _
              (fail "Wrong syntax for _$")}
-- 
cgit v1.2.3