diff options
author | Eduardo Julian | 2018-05-23 21:23:57 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-05-23 21:23:57 -0400 |
commit | 717ed15dc264d26a642adf22137fac6d526aff25 (patch) | |
tree | 1abb7691dd7f0e980e06055580a51ac1b4fe8337 /stdlib/source/lux.lux | |
parent | 0f32fc8e73681d860d12a5560952ed6640f034f1 (diff) |
- Minor improvements.
Diffstat (limited to 'stdlib/source/lux.lux')
-rw-r--r-- | stdlib/source/lux.lux | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index d6a399463..b84b0d096 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -700,8 +700,8 @@ ## #expected (Maybe Type) ## #seed Nat ## #scope-type-vars (List Nat) -## #extensions Nothing -## #host Nothing}) +## #extensions Any +## #host Any}) ("lux def" Lux (#Named ["lux" "Lux"] (#Product ## "lux.info" @@ -725,9 +725,9 @@ (#Product ## scope-type-vars (#Apply Nat List) (#Product ## extensions - Nothing + Any ## "lux.host" - Nothing)))))))))))) + Any)))))))))))) (record$ (#Cons [(tag$ ["lux" "tags"]) (tuple$ (#Cons (text$ "info") (#Cons (text$ "source") @@ -5723,33 +5723,15 @@ (:: Monad<Meta> return token) )) -(macro: #export (^~ tokens) - {#.doc (doc "Use global definitions with simple values, such as text, int, frac and bool in place of literals in patterns." - "The definitions must be properly-qualified (though you may use one of the short-cuts Lux provides)." - (def: (empty?' node) - (All [K V] (-> (Node K V) Bool)) - (case node - (^~ (#Base ..clean-bitmap _)) - true - - _ - false)))} +(macro: #export (static tokens) (case tokens - (^ (list& [_ (#Form (list pattern))] body branches)) + (^ (list pattern)) (do Monad<Meta> - [module-name current-module-name - pattern+ (macro-expand-all pattern)] - (case pattern+ - (^ (list pattern')) - (do Monad<Meta> - [pattern'' (anti-quote pattern')] - (wrap (list& pattern'' body branches))) - - _ - (fail "^~ can only expand to 1 pattern."))) + [pattern' (anti-quote pattern)] + (wrap (list pattern'))) _ - (fail "Wrong syntax for ^~"))) + (fail "Wrong syntax for \"static\"."))) (type: Multi-Level-Case [Code (List [Code Code])]) |