diff options
author | Eduardo Julian | 2022-06-16 21:37:38 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-06-16 21:37:38 -0400 |
commit | 7249707e7c09be68dfb7507ba363efd3300a0141 (patch) | |
tree | 1fb4764458da16353315ea7e267f997c9be70f49 /documentation/book/the_lux_programming_language/appendix_a.md | |
parent | e00e0b5f1e5fb509cf8f32424397110f524b8148 (diff) |
De-sigil-ification: suffix : [Part 14]
Diffstat (limited to 'documentation/book/the_lux_programming_language/appendix_a.md')
-rw-r--r-- | documentation/book/the_lux_programming_language/appendix_a.md | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/documentation/book/the_lux_programming_language/appendix_a.md b/documentation/book/the_lux_programming_language/appendix_a.md index 4002c13e9..605658385 100644 --- a/documentation/book/the_lux_programming_language/appendix_a.md +++ b/documentation/book/the_lux_programming_language/appendix_a.md @@ -5,7 +5,7 @@ You've already seen some import syntax, but now you'll see all the options avail If you recall [Chapter 1](chapter_1.md), there was this example code: ```clojure -(.using +(.require [library [lux "*" [program {"+" program:}] @@ -38,7 +38,7 @@ We also give both of those modules local aliases. That is what that `"[0]"` syntax does. -The `.using` macro recognizes that syntax for aliases and replaces the `[0]` with the import name directly to the right. +The `.require` macro recognizes that syntax for aliases and replaces the `[0]` with the import name directly to the right. That means: * `"[0]"` + `debug` = `debug` @@ -52,10 +52,10 @@ So, for example: It is also important to note that while imports can be nested for convenience, they don't have to be. -The `.using` declaration could just as easily been written like this: +The `.require` declaration could just as easily been written like this: ```clojure -(.using +(.require [library/lux "*"] [library/lux/program {"+" program:}] ["debug" library/lux/debug] @@ -68,12 +68,12 @@ Any module-path fragments included in the import syntax without such options wil --- -It is also possible to have the `.using` macro open interface implementations for you when importing the modules that contain them. +It is also possible to have the `.require` macro open interface implementations for you when importing the modules that contain them. For example: ```clojure -(.using +(.require [library [lux "*" [data @@ -105,7 +105,7 @@ The `[1]` syntax for aliasing can also be used between modules, and not just whe For example: ```clojure -(.using +(.require [library [lux "*" [data @@ -125,7 +125,7 @@ Non-aliased paths don't count as context. This means: ```clojure -(.using +(.require [library [lux "*" ["[0]" data "_" @@ -145,7 +145,7 @@ I should also note that you can **both** locally import definitions and open imp For example: ```clojure -(.using +(.require [library [lux "*" [data @@ -178,7 +178,7 @@ You can import other modules in the hierarchy like this: ```clojure ... In program/foo/baz -(.using +(.require [library [lux "*"]] ["[0]" /quux] ... program/foo/baz/quux, aliased as /quux @@ -191,7 +191,7 @@ A single forward slash (`/`) signifies _"this module"_ in the hierarchy, so anyt Two forward slashes (`//`) signify _"the module above"_, and any forward slash after that allows you to go further **up** the hierarchy. -In the case of `program`, it's enough to just specify three forward slashes (`///`) for the `.using` macro to know which module you're referring to. +In the case of `program`, it's enough to just specify three forward slashes (`///`) for the `.require` macro to know which module you're referring to. You can think about it like this: @@ -203,7 +203,7 @@ Also, this relative path syntax can be nested, like so: ```clojure ... In program/foo/baz -(.using +(.require [library [lux "*"]] [/ @@ -219,7 +219,7 @@ Or even: ```clojure ... In program/foo/baz -(.using +(.require [library [lux "*"]] [/ @@ -240,7 +240,7 @@ For the second way to do relative imports, you can see this example: ```clojure ... In program/foo/baz -(.using +(.require [library [lux "*"]] [\\test |