diff options
author | Eduardo Julian | 2020-12-23 06:33:44 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-12-23 06:33:44 -0400 |
commit | d29e091e98dabb8dfcf816899ada480ecbf7e357 (patch) | |
tree | a9d34c7fbb700cdb0c1f1226d377150614ce9914 /stdlib/source/lux/type/unit.lux | |
parent | cad959345afb8bf0bd1e5eefe6c63f136833b3ce (diff) |
Refactored "export" common syntax.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/type/unit.lux | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/stdlib/source/lux/type/unit.lux b/stdlib/source/lux/type/unit.lux index deffa4e83..9f5fdba78 100644 --- a/stdlib/source/lux/type/unit.lux +++ b/stdlib/source/lux/type/unit.lux @@ -20,7 +20,8 @@ [syntax (#+ syntax:) ["cs" common ["csr" reader] - ["csw" writer]]]] + ["csw" writer] + ["|.|" export]]]] [type abstract]]) @@ -70,13 +71,13 @@ ) (syntax: #export (unit: - {export csr.export} + {export |export|.parser} {name s.local-identifier} {annotations (p.default cs.empty-annotations csr.annotations)}) - (wrap (list (` (type: (~+ (csw.export export)) (~ (code.local-identifier name)) + (wrap (list (` (type: (~+ (|export|.write export)) (~ (code.local-identifier name)) (~ (csw.annotations annotations)) (primitive (~ (code.text (unit-name name)))))) - (` (def: (~+ (csw.export export)) (~ (code.local-identifier (format "@" name))) + (` (def: (~+ (|export|.write export)) (~ (code.local-identifier (format "@" name))) (~ (code.local-identifier name)) (:assume []))) ))) @@ -93,15 +94,15 @@ (wrap [(.nat numerator) (.nat denominator)])))) (syntax: #export (scale: - {export csr.export} + {export |export|.parser} {name s.local-identifier} {(^slots [#ratio.numerator #ratio.denominator]) ratio^} {annotations (p.default cs.empty-annotations csr.annotations)}) (let [g!scale (code.local-identifier name)] - (wrap (list (` (type: (~+ (csw.export export)) ((~ g!scale) (~' u)) + (wrap (list (` (type: (~+ (|export|.write export)) ((~ g!scale) (~' u)) (~ (csw.annotations annotations)) (primitive (~ (code.text (scale-name name))) [(~' u)]))) - (` (structure: (~+ (csw.export export)) (~ (code.local-identifier (format "@" name))) + (` (structure: (~+ (|export|.write export)) (~ (code.local-identifier (format "@" name))) (..Scale (~ g!scale)) (def: (~' scale) (|>> ..out |