From 7db42ab1b9d3c764772ca63c74bf44bb2b8b8325 Mon Sep 17 00:00:00 2001
From: Eduardo Julian
Date: Sat, 9 Jul 2022 14:35:38 -0400
Subject: First-class programs instead of having a "lux program" extension.

---
 lux-lua/source/program.lux | 73 +++++++++++++++++++++++-----------------------
 1 file changed, 37 insertions(+), 36 deletions(-)

(limited to 'lux-lua')

diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux
index 824b2b33b..150feec52 100644
--- a/lux-lua/source/program.lux
+++ b/lux-lua/source/program.lux
@@ -1,7 +1,7 @@
 (.require
  [library
   [lux (.except)
-   [program (.only program:)]
+   [program (.only program)]
    ["[0]" ffi]
    [abstract
     ["[0]" monad (.only do)]]
@@ -881,38 +881,39 @@
   (-> Any platform.Custom)
   (undefined))
 
-(`` (program: [service cli.service]
-      (let [context (context.lua (cli.target service))]
-        (do io.monad
-          [(,, (for @.old [baggage platform]
-                    @.jvm [baggage platform]
-                    @.lua platform))
-           ..platform]
-          (exec (do async.monad
-                  [_ (/.compiler ..lux_compiler
-                                 context
-                                 (for @.old (..expander ..to_host baggage)
-                                      @.jvm (..expander ..to_host baggage)
-                                      @.lua ..expander)
-                                 analysis.bundle
-                                 (io.io platform)
-                                 generation.bundle
-                                 (function.constant extension/bundle.empty)
-                                 ..program
-                                 [(type_literal [Register _.Label])
-                                  _.Expression
-                                  _.Statement]
-                                 (for @.old (..extender baggage)
-                                      @.jvm (..extender baggage)
-                                      @.lua ..extender)
-                                 service
-                                 [(packager.package (_.manual "")
-                                                    _.code
-                                                    _.then
-                                                    (|>>))
-                                  (format (cli.target service)
-                                          (at file.default separator)
-                                          "program"
-                                          (the context.#artifact_extension context))])]
-                  (..declare_success! []))
-            (io.io []))))))
+(`` (def _
+      (program [service cli.service]
+        (let [context (context.lua (cli.target service))]
+          (do io.monad
+            [(,, (for @.old [baggage platform]
+                      @.jvm [baggage platform]
+                      @.lua platform))
+             ..platform]
+            (exec (do async.monad
+                    [_ (/.compiler ..lux_compiler
+                                   context
+                                   (for @.old (..expander ..to_host baggage)
+                                        @.jvm (..expander ..to_host baggage)
+                                        @.lua ..expander)
+                                   analysis.bundle
+                                   (io.io platform)
+                                   generation.bundle
+                                   (function.constant extension/bundle.empty)
+                                   ..program
+                                   [(type_literal [Register _.Label])
+                                    _.Expression
+                                    _.Statement]
+                                   (for @.old (..extender baggage)
+                                        @.jvm (..extender baggage)
+                                        @.lua ..extender)
+                                   service
+                                   [(packager.package (_.manual "")
+                                                      _.code
+                                                      _.then
+                                                      (|>>))
+                                    (format (cli.target service)
+                                            (at file.default separator)
+                                            "program"
+                                            (the context.#artifact_extension context))])]
+                    (..declare_success! []))
+              (io.io [])))))))
-- 
cgit v1.2.3