Skip to content

Commit ce4db9a

Browse files
authored
Merge pull request #696 from NoahTheDuke/nb/ask-14004-namespaced-maps-example
Add :_/foo example for namespaced maps
2 parents a8a9224 + af05689 commit ce4db9a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

content/guides/weird_characters.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,30 @@ is read the same as:
539539
:rebel.ship/model "YT-1300f light freighter"}}
540540
----
541541

542+
Finally, if a keyword is qualified, then the given namespace is used. And if the keyword has the namespace `_`, then it is treated as having no namespace:
543+
544+
[source,clojure]
545+
----
546+
#:shape{:_/type "Square"
547+
:location/x 10
548+
:location/y 12
549+
:sides 4
550+
:width 2
551+
:height 2}
552+
----
553+
554+
is read the same as:
555+
556+
[source,clojure]
557+
----
558+
{:type "Square"
559+
:location/x 10
560+
:location/y 12
561+
:shape/sides 4
562+
:shape/width 2
563+
:shape/height 2}
564+
----
565+
542566
* <<xref/../../reference/reader#map_namespace_syntax,Reader>>
543567

544568
== `/` - Namespace separator

0 commit comments

Comments
 (0)