diff options
Diffstat (limited to 'stdlib/source/library/lux/target/r.lux')
-rw-r--r-- | stdlib/source/library/lux/target/r.lux | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/stdlib/source/library/lux/target/r.lux b/stdlib/source/library/lux/target/r.lux index 20aeb8d4b..3b6601179 100644 --- a/stdlib/source/library/lux/target/r.lux +++ b/stdlib/source/library/lux/target/r.lux @@ -22,48 +22,48 @@ [type abstract]]]) -(abstract: #export (Code kind) +(abstract: .public (Code kind) Text {} (template [<type> <super>+] [(with_expansions [<kind> (template.identifier [<type> "'"])] - (abstract: #export (<kind> kind) Any) - (`` (type: #export <type> (|> Any <kind> (~~ (template.spliced <super>+))))))] + (abstract: .public (<kind> kind) Any) + (`` (type: .public <type> (|> Any <kind> (~~ (template.spliced <super>+))))))] [Expression [Code]] ) (template [<type> <super>+] [(with_expansions [<kind> (template.identifier [<type> "'"])] - (abstract: #export (<kind> kind) Any) - (`` (type: #export (<type> <brand>) (|> <brand> <kind> (~~ (template.spliced <super>+))))))] + (abstract: .public (<kind> kind) Any) + (`` (type: .public (<type> <brand>) (|> <brand> <kind> (~~ (template.spliced <super>+))))))] [Var [Expression' Code]] ) (template [<var> <kind>] - [(abstract: #export <kind> Any) - (type: #export <var> (Var <kind>))] + [(abstract: .public <kind> Any) + (type: .public <var> (Var <kind>))] [SVar Single] [PVar Poly] ) - (def: #export var + (def: .public var (-> Text SVar) (|>> :abstraction)) - (def: #export var_args + (def: .public var_args PVar (:abstraction "...")) - (def: #export manual + (def: .public manual (-> Text Code) (|>> :abstraction)) - (def: #export code + (def: .public code (-> (Code Any) Text) (|>> :representation)) @@ -84,7 +84,7 @@ (-> Text Text) (format "{" (nested expression) text.new_line "}")) - (def: #export (block expression) + (def: .public (block expression) (-> Expression Expression) (:abstraction (format "{" @@ -92,7 +92,7 @@ text.new_line "}"))) (template [<name> <r>] - [(def: #export <name> + [(def: .public <name> Expression (:abstraction <r>))] @@ -101,24 +101,24 @@ ) (template [<name>] - [(def: #export <name> Expression n/a)] + [(def: .public <name> Expression n/a)] [not_available] [not_applicable] [no_answer] ) - (def: #export bool + (def: .public bool (-> Bit Expression) (|>> (case> #0 "FALSE" #1 "TRUE") :abstraction)) - (def: #export int + (def: .public int (-> Int Expression) (|>> %.int :abstraction)) - (def: #export float + (def: .public float (-> Frac Expression) (|>> (cond> [(f.= f.positive_infinity)] [(new> "1.0/0.0" [])] @@ -149,23 +149,23 @@ )) ))) - (def: #export string + (def: .public string (-> Text Expression) (|>> ..safe %.text :abstraction)) - (def: #export (slice from to list) + (def: .public (slice from to list) (-> Expression Expression Expression Expression) (..self_contained (format (:representation list) "[" (:representation from) ":" (:representation to) "]"))) - (def: #export (slice_from from list) + (def: .public (slice_from from list) (-> Expression Expression Expression) (..self_contained (format (:representation list) "[-1" ":-" (:representation from) "]"))) - (def: #export (apply args func) + (def: .public (apply args func) (-> (List Expression) Expression Expression) (let [func (:representation func) spacing (|> " " (list.repeat (text.size func)) (text.join_with ""))] @@ -178,7 +178,7 @@ ")")))) (template [<name> <function>] - [(def: #export (<name> members) + [(def: .public (<name> members) (-> (List Expression) Expression) (..apply members (..var <function>)))] @@ -186,13 +186,13 @@ [list "list"] ) - (def: #export named_list + (def: .public named_list (-> (List [Text Expression]) Expression) (|>> (list\map (.function (_ [key value]) (:abstraction (format key "=" (:representation value))))) ..list)) - (def: #export (apply_kw args kw_args func) + (def: .public (apply_kw args kw_args func) (-> (List Expression) (List [Text Expression]) Expression Expression) (..self_contained (format (:representation func) @@ -218,12 +218,12 @@ <inputs> (arity_inputs <arity>) <types> (arity_types <arity>) <definitions> (template.spliced <function>+)] - (def: #export (<apply> function [<inputs>]) + (def: .public (<apply> function [<inputs>]) (-> Expression [<types>] Expression) (..apply (.list <inputs>) function)) (template [<function>] - [(`` (def: #export (~~ (template.identifier [<function> "/" <arity>])) + [(`` (def: .public (~~ (template.identifier [<function> "/" <arity>])) (-> [<types>] Expression) (<apply> (..var <function>))))] @@ -237,30 +237,30 @@ [["paste"]]] ) - (def: #export as::integer + (def: .public as::integer (-> Expression Expression) (..apply/1 (..var "as.integer"))) - (def: #export (item idx list) + (def: .public (item idx list) (-> Expression Expression Expression) (..self_contained (format (:representation list) "[[" (:representation idx) "]]"))) - (def: #export (if test then else) + (def: .public (if test then else) (-> Expression Expression Expression Expression) (:abstraction (format "if(" (:representation test) ")" " " (.._block (:representation then)) " else " (.._block (:representation else))))) - (def: #export (when test then) + (def: .public (when test then) (-> Expression Expression Expression) (:abstraction (format "if(" (:representation test) ") {" (.._block (:representation then)) text.new_line "}"))) - (def: #export (cond clauses else) + (def: .public (cond clauses else) (-> (List [Expression Expression]) Expression Expression) (list\fold (.function (_ [test then] next) (if test then next)) @@ -268,7 +268,7 @@ (list.reversed clauses))) (template [<name> <op>] - [(def: #export (<name> param subject) + [(def: .public (<name> param subject) (-> Expression Expression Expression) (..self_contained (format (:representation subject) @@ -291,7 +291,7 @@ ) (template [<name> <func>] - [(def: #export (<name> param subject) + [(def: .public (<name> param subject) (-> Expression Expression Expression) (..apply (.list subject param) (..var <func>)))] @@ -302,12 +302,12 @@ [bit_ushr "bitwShiftR"] ) - (def: #export (bit_not subject) + (def: .public (bit_not subject) (-> Expression Expression) (..apply (.list subject) (..var "bitwNot"))) (template [<name> <op>] - [(def: #export <name> + [(def: .public <name> (-> Expression Expression) (|>> :representation (format <op>) ..self_contained))] @@ -315,23 +315,23 @@ [negate "-"] ) - (def: #export (length list) + (def: .public (length list) (-> Expression Expression) (..apply (.list list) (..var "length"))) - (def: #export (range from to) + (def: .public (range from to) (-> Expression Expression Expression) (..self_contained (format (:representation from) ":" (:representation to)))) - (def: #export (function inputs body) + (def: .public (function inputs body) (-> (List (Ex [k] (Var k))) Expression Expression) (let [args (|> inputs (list\map ..code) (text.join_with ", "))] (..self_contained (format "function(" args ") " (.._block (:representation body)))))) - (def: #export (try body warning error finally) + (def: .public (try body warning error finally) (-> Expression (Maybe Expression) (Maybe Expression) (Maybe Expression) Expression) (let [optional (: (-> Text (Maybe Expression) (-> Text Text) Text) (.function (_ parameter value preparation) @@ -346,20 +346,20 @@ (optional "finally" finally .._block) ")")))) - (def: #export (while test body) + (def: .public (while test body) (-> Expression Expression Expression) (..self_contained (format "while (" (:representation test) ") " (.._block (:representation body))))) - (def: #export (for_in var inputs body) + (def: .public (for_in var inputs body) (-> SVar Expression Expression Expression) (..self_contained (format "for (" (:representation var) " in " (:representation inputs) ")" (.._block (:representation body))))) (template [<name> <keyword>] - [(def: #export (<name> message) + [(def: .public (<name> message) (-> Expression Expression) (..apply (.list message) (..var <keyword>)))] @@ -367,17 +367,17 @@ [print "print"] ) - (def: #export (set! var value) + (def: .public (set! var value) (-> SVar Expression Expression) (..self_contained (format (:representation var) " <- " (:representation value)))) - (def: #export (set_item! idx value list) + (def: .public (set_item! idx value list) (-> Expression Expression SVar Expression) (..self_contained (format (:representation list) "[[" (:representation idx) "]] <- " (:representation value)))) - (def: #export (then pre post) + (def: .public (then pre post) (-> Expression Expression Expression) (:abstraction (format (:representation pre) |