From 717ed15dc264d26a642adf22137fac6d526aff25 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 23 May 2018 21:23:57 -0400 Subject: - Minor improvements. --- stdlib/source/lux.lux | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) (limited to 'stdlib/source/lux.lux') 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 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 - [module-name current-module-name - pattern+ (macro-expand-all pattern)] - (case pattern+ - (^ (list pattern')) - (do Monad - [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])]) -- cgit v1.2.3