diff options
author | Eduardo Julian | 2023-01-04 18:37:14 -0400 |
---|---|---|
committer | Eduardo Julian | 2023-01-04 18:37:14 -0400 |
commit | 3ca054b6b992e2233d763aabc5c938ee10d116a4 (patch) | |
tree | 90b93c5a922fa312331f33cc4c93962c76db4636 /stdlib/source/library/lux.lux | |
parent | ad1391ea1cdd33167339d25dbff2567f5a8d5c68 (diff) |
Added simple machinery for aliasing of definitions.
Diffstat (limited to 'stdlib/source/library/lux.lux')
-rw-r--r-- | stdlib/source/library/lux.lux | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index 763b1b25f..e6108721f 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -3292,7 +3292,7 @@ _ ... TODO: Figure out why this doesn't work: - ... (of meta#monad in token) + ... (meta#in token) (meta#in token)} token)))) @@ -5479,14 +5479,15 @@ (again &rest (property#with var_name expansion map))) {#End} - (of meta#monad #in (list#conjoint (list#each normal bodies)))))) + (meta#in (list#conjoint (list#each normal bodies)))))) {#None} (failure (..wrong_syntax_error (symbol ..with_expansions))))))) (def .public (same? reference sample) - (All (_ a) - (-> a a Bit)) + (All (_ of) + (-> of of + Bit)) (.is?# reference sample)) (def .public as_expected @@ -5878,5 +5879,22 @@ [Declaration] ) -(type .public F64 Frac) -(type .public Double Frac) +(def .public alias + (macro (_ tokens) + (when (parsed (andP (tupleP (manyP localP)) + symbolP) + tokens) + {#Some [alias/+ original]} + (meta#in (list#each (function (_ it) + (` (def .public (, (local$ it)) + (, (symbol$ original))))) + alias/+)) + + {#None} + (failure (..wrong_syntax_error (symbol ..alias)))))) + +(alias [F64 Double] + ..Frac) + +(alias [alias?] + ..same?) |