aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/meta
diff options
context:
space:
mode:
authorEduardo Julian2022-08-17 02:54:41 -0400
committerEduardo Julian2022-08-17 02:54:41 -0400
commit261172e7a4cff7b9978eec4c0d32e963cbe7486e (patch)
treebf3c79319eef3bda7e1efe6612e3d6ea546e1e85 /stdlib/source/library/lux/meta
parent0f9bc13a34b729d9ae9db31276feb2a66785d06b (diff)
Proper testing for debug.log!
Diffstat (limited to 'stdlib/source/library/lux/meta')
-rw-r--r--stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux17
-rw-r--r--stdlib/source/library/lux/meta/compiler/meta.lux2
-rw-r--r--stdlib/source/library/lux/meta/target/js.lux4
-rw-r--r--stdlib/source/library/lux/meta/type/resource.lux20
-rw-r--r--stdlib/source/library/lux/meta/version.lux2
5 files changed, 23 insertions, 22 deletions
diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux
index 73a240682..8848c781d 100644
--- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux
+++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux
@@ -722,18 +722,19 @@
(io//log message)
(let [console (_.var "console")
print (_.var "print")
- end! (_.return ..unit)]
- (<| (_.if (|> console _.type_of (_.= (_.string "undefined")) _.not
- (_.and (_.the "log" console)))
+ end! (_.return ..unit)
+
+ has_console? (|> console _.type_of (_.= (_.string "undefined")) _.not)
+ node_or_browser? (|> has_console?
+ (_.and (_.the "log" console)))
+ nashorn? (|> print _.type_of (_.= (_.string "undefined")) _.not)]
+ (<| (_.if node_or_browser?
(all _.then
(_.statement (|> console (_.do "log" (list message))))
end!))
- (_.if (|> print _.type_of (_.= (_.string "undefined")) _.not)
+ (_.if nashorn?
(all _.then
- (_.statement (_.apply_1 print (_.? (_.= (_.string "string")
- (_.type_of message))
- message
- (_.apply_1 (_.var "JSON.stringify") message))))
+ (_.statement (_.apply_1 print message))
end!))
end!)))
diff --git a/stdlib/source/library/lux/meta/compiler/meta.lux b/stdlib/source/library/lux/meta/compiler/meta.lux
index 00e782b29..259d09b6e 100644
--- a/stdlib/source/library/lux/meta/compiler/meta.lux
+++ b/stdlib/source/library/lux/meta/compiler/meta.lux
@@ -6,4 +6,4 @@
(def .public version
Version
- 00,02,00)
+ 00,03,00)
diff --git a/stdlib/source/library/lux/meta/target/js.lux b/stdlib/source/library/lux/meta/target/js.lux
index 37792d6bc..0a56ad62a 100644
--- a/stdlib/source/library/lux/meta/target/js.lux
+++ b/stdlib/source/library/lux/meta/target/js.lux
@@ -312,8 +312,8 @@
(abstraction (format "var " (representation name) " = " (representation value) ..statement_suffix)))
(def .public (set name value)
- (-> Location Expression Statement)
- (abstraction (format (representation name) " = " (representation value) ..statement_suffix)))
+ (-> Location Expression Expression)
+ (abstraction (format (representation name) " = " (representation value))))
(def .public (throw message)
(-> Expression Statement)
diff --git a/stdlib/source/library/lux/meta/type/resource.lux b/stdlib/source/library/lux/meta/type/resource.lux
index 904ee3129..acf620981 100644
--- a/stdlib/source/library/lux/meta/type/resource.lux
+++ b/stdlib/source/library/lux/meta/type/resource.lux
@@ -3,7 +3,7 @@
[lux (.except)
[abstract
["[0]" monad (.only Monad do)
- [indexed (.only IxMonad)]]]
+ ["[0]" indexed]]]
[control
["<>" parser]
["[0]" maybe]
@@ -26,23 +26,23 @@
[//
[primitive (.except)]])
-(type .public (Procedure monad input output value)
- (-> input (monad [output value])))
+(type .public (Procedure ! input output value)
+ (-> input (! [output value])))
-(type .public (Linear monad value)
+(type .public (Linear ! value)
(All (_ keys)
- (Procedure monad keys keys value)))
+ (Procedure ! keys keys value)))
-(type .public (Affine monad permissions value)
+(type .public (Affine ! permissions value)
(All (_ keys)
- (Procedure monad keys [permissions keys] value)))
+ (Procedure ! keys [permissions keys] value)))
-(type .public (Relevant monad permissions value)
+(type .public (Relevant ! permissions value)
(All (_ keys)
- (Procedure monad [permissions keys] keys value)))
+ (Procedure ! [permissions keys] keys value)))
(def .public (monad monad)
- (All (_ !) (-> (Monad !) (IxMonad (Procedure !))))
+ (All (_ !) (-> (Monad !) (indexed.Monad (Procedure !))))
(implementation
(def (in value)
(function (_ keys)
diff --git a/stdlib/source/library/lux/meta/version.lux b/stdlib/source/library/lux/meta/version.lux
index b25439e57..e9b83c9bd 100644
--- a/stdlib/source/library/lux/meta/version.lux
+++ b/stdlib/source/library/lux/meta/version.lux
@@ -20,7 +20,7 @@
(def .public latest
Version
- 00,07,00)
+ 00,08,00)
(def .public current
(syntax (_ [])