-
Notifications
You must be signed in to change notification settings - Fork 15
Namespaces
(namespace Name Exceptions
Code)
Name
is a symbol representing the name.
Exceptions
is a list of exclude prefixes.
All other symbols in Code
excluding cases listed below have prefix
Name-
, where Name
is a namespace name.
- System functions (
define
,+
,reverse
, ...) are left untouched. - Symbols with prefixes
X-
whereX
is an element ofExceptions
list are left untouched.
Example:
(namespace mod-one- [mod-zero-]
[a b c mod-zero-a mod-two-b])
Result:
[mod-one-a mod-one-b mod-one-c mod-zero-a mod-one-mod-two-b]
(subnamespace prefix exceptions
Code)
prefix
is a symbol, representing namespace within the scope of the form.
prefix
is attached to symbols within the scope of the form after namespace
name prefix.
exceptions
is a list of symbols, which are not prefixed neither by
namespace name prefix nor subnamespace prefix.
Example:
(namespace mod1 []
(subnamespace ns1 [d]
[a b c d]))
Result:
[mod1-ns1-a mod1-ns1-b mod1-ns1-c d]
(namespace-synonyms (name alias
name1 alias1 ... )
Code)
name
is a symbol, which represents namespace original name, and alias
is
a symbol, representing namespace alias. In all symbols, beginning with
alias-
, alias-
will be replaced by name-
.
Example:
(namespace mod1 []
(subnamespace ns1 [a b]
(namespace-synonyms (name1 n1
name2 n2)
[a b c d n1-e n2-f])))
Result:
[a b mod1-ns1-c mod1-ns1-d name1-e name2-f]
(from-namespace name symbols
Code)
name
is a symbol, which represents namespace name or alias (defined in
upper namespace-synonym
), and symbols
is a list of symbols, which will be
prepended by original namespace name.
Example:
(namespace mod1 []
(subnamespace ns1 [a b]
(from-namespace name1 [e f]
[a b c d e f])))
Result:
[a b mod1-ns1-c mod1-ns1-d name1-e name1-f]
(not-in-namespace
Code)
not-in-namespace
discards all symbols prefixing rules (introduced by upper
namespace, subnamespace etc, forms) within its scope.
Example:
(namespace mod1 []
(subnamespace ns1 [a b]
(from-namespace name1 [e f]
[a b c d e f (not-in-namespace e)]
(not-in-namespace [a b c d e f]))))
Result:
[a b mod1-ns1-c mod1-ns1-d name1-e name1-f e]
[a b c d e f]