aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux')
-rw-r--r--stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux55
1 files changed, 30 insertions, 25 deletions
diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux
index 2a64aeb1e..b47bade2d 100644
--- a/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux
+++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux
@@ -53,7 +53,7 @@
(template: (!unary function)
(|>> list _.apply/* (|> (_.constant function))))
-## TODO: Get rid of this ASAP
+## ## TODO: Get rid of this ASAP
## (def: lux::syntax_char_case!
## (..custom [($_ <>.and
## <s>.any
@@ -74,18 +74,18 @@
## branchG])))
## conditionals))]
## (wrap (_.let (list [@input inputG])
-## (list\fold (function (_ [test then] else)
-## (_.if test then else))
-## elseG
-## conditionalsG)))))]))
+## (list (list\fold (function (_ [test then] else)
+## (_.if test then else))
+## elseG
+## conditionalsG))))))]))
-## (def: lux_procs
-## Bundle
-## (|> /.empty
-## (/.install "syntax char case!" lux::syntax_char_case!)
-## (/.install "is" (binary (product.uncurry _.eq?/2)))
-## (/.install "try" (unary //runtime.lux//try))
-## ))
+(def: lux_procs
+ Bundle
+ (|> /.empty
+ ## (/.install "syntax char case!" lux::syntax_char_case!)
+ (/.install "is" (binary _.eq/2))
+ ## (/.install "try" (unary //runtime.lux//try))
+ ))
## (def: (capped operation parameter subject)
## (-> (-> Expression Expression Expression)
@@ -128,13 +128,17 @@
## (/.install "decode" (unary //runtime.f64//decode))
)))
-## (def: (text//index [offset sub text])
-## (Trinary Expression)
-## (//runtime.text//index offset sub text))
+(def: (text//index [offset sub text])
+ (Trinary (Expression Any))
+ (//runtime.text//index offset sub text))
+
+(def: (text//clip [offset length text])
+ (Trinary (Expression Any))
+ (//runtime.text//clip offset length text))
-## (def: (text//clip [paramO extraO subjectO])
-## (Trinary Expression)
-## (//runtime.text//clip paramO extraO subjectO))
+(def: (text//char [index text])
+ (Binary (Expression Any))
+ (_.char-code/1 (_.char/2 [text index])))
(def: text_procs
Bundle
@@ -144,16 +148,17 @@
## (/.install "<" (binary (product.uncurry _.string<?/2)))
(/.install "concat" (binary (function (_ [left right])
(_.concatenate/3 [(_.symbol "string") left right]))))
- ## (/.install "index" (trinary ..text//index))
- ## (/.install "size" (unary _.string-length/1))
- ## (/.install "char" (binary (product.uncurry //runtime.text//char)))
- ## (/.install "clip" (trinary ..text//clip))
+ (/.install "index" (trinary ..text//index))
+ (/.install "size" (unary _.length/1))
+ (/.install "char" (binary ..text//char))
+ (/.install "clip" (trinary ..text//clip))
)))
(def: (io//log! message)
(Unary (Expression Any))
- (_.progn (_.write-line/1 message)
- //runtime.unit))
+ (_.progn (list (_.pprint/1 message)
+ ## (_.write-line/1 message)
+ //runtime.unit)))
(def: io_procs
Bundle
@@ -168,7 +173,7 @@
Bundle
(<| (/.prefix "lux")
(|> /.empty
- ## (dictionary.merge lux_procs)
+ (dictionary.merge lux_procs)
(dictionary.merge i64_procs)
(dictionary.merge f64_procs)
(dictionary.merge text_procs)