Skip to content

Commit b1a13b9

Browse files
committed
add code formatting to headers
1 parent 601360e commit b1a13b9

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

content/guides/weird_characters.adoc

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ are grouped for ease. This guide is a copy of http://twitter.com/kouphax[James H
1717
brilliant https://yobriefca.se/blog/2014/05/19/the-weird-and-wonderful-characters-of-clojure/[blog post] of the same name.
1818
====
1919
[[dispatch]]
20-
== # - Dispatch macro
20+
== `#` - Dispatch macro
2121

2222
You'll see this macro character beside another e.g. `\#(` or `#"`.
2323
// " Comment needed for emacs to behave.
@@ -74,7 +74,7 @@ and in ClojureScript (`#js`). See <<xref/../weird_characters#tagged_literals,`#
7474
* http://briancarper.net/blog/449/[Clojure Reader Macros]
7575
* http://clojuredocs.org/clojure_core/clojure.core/gensym[ClojureDocs - gensyms]
7676

77-
== #{ - Set macro
77+
== `#{` - Set macro
7878

7979
See <<xref/../weird_characters#dispatch,(`#`)>> for additional details.
8080

@@ -103,7 +103,7 @@ user=> (set [1 2 3 4 1]) ; convert vector to set, removing duplicates
103103

104104
* <<xref/../../reference/data_structures#sets,Clojure Documentation: Sets>>
105105

106-
== #_ - Discard macro
106+
== `#_` - Discard macro
107107

108108
See <<xref/../weird_characters#dispatch,(`#`)>> for additional details.
109109

@@ -129,7 +129,7 @@ This can prove useful for debugging situations or for multiline comments.
129129
* <<xref/../../reference/reader#,Clojure Documentation - Reader>>
130130
* https://github.com/edn-format/edn#tagged-elements[EDN Tagged Elements]
131131

132-
== #" - Regular Expression macro
132+
== `#"` - Regular Expression macro
133133
// " for the pleasure of emacs.
134134

135135
See <<xref/../weird_characters#dispatch,(`#`)>> for additional details.
@@ -147,7 +147,7 @@ it is not available in EDN.
147147

148148
* <<xref/../../reference/other_functions#regex,Clojure Documentation: Regex Support>>
149149

150-
== #( - Function macro
150+
== `#(` - Function macro
151151

152152
See <<xref/../weird_characters#dispatch,(`#`)>> for additional details.
153153

@@ -173,7 +173,7 @@ user=> (macroexpand `#(println %))
173173
(fn* [arg] (clojure.core/println arg)) ; argument names shortened for clarity
174174
----
175175

176-
== #' - Var macro
176+
== `#'` - Var macro
177177

178178
`#'` is the var quote which expands into the `var` function:
179179

@@ -199,7 +199,7 @@ Note that the var quote is not available in EDN.
199199
* <<xref/../../reference/special_forms#var,Clojure Official Documentation: Special Forms>>
200200

201201
[[tagged_literals]]
202-
== #inst, #uuid, and #js etc. - tagged literals
202+
== `#inst`, `#uuid`, and `#js` etc. - tagged literals
203203

204204
Commonly found in EDN and Clojure/ClojureScript this use of `#` is called
205205
the _tagged literal_. Look at this example:
@@ -235,7 +235,7 @@ Note that while `#inst` and `#uuid` are available in EDN, `#js` isn't.
235235

236236
* https://github.com/edn-format/edn#tagged-elements[EDN Tagged Elements]
237237

238-
== % - Argument placeholder
238+
== `%` - Argument placeholder
239239

240240
`%` is not a macro, but a placeholder for use in the `#(` macro. It represents
241241
an argument that will be passed into the function when it is expanded.
@@ -277,7 +277,7 @@ user=> (macroexpand '#(println %&))
277277

278278
Note that `%&` is not available in EDN.
279279

280-
== @ - Deref macro
280+
== `@` - Deref macro
281281

282282
`@` is the shorthand equivalent of the `deref` function so these two forms
283283
are the same:
@@ -298,7 +298,7 @@ force computation and potentially block.
298298

299299
Note that `@` is not available in EDN.
300300

301-
== ^ - Metadata
301+
== `^` - Metadata
302302

303303
`^` is the metadata marker. Metadata is a map of values (with shorthand option)
304304
that can be attached to various forms in Clojure. This provides extra information
@@ -354,7 +354,7 @@ Note that metadata is available in EDN, but bype hints are not.
354354
* <<xref/../../reference/metadata#,Clojure Official Documentation>>
355355
* http://en.wikibooks.org/wiki/Learning_Clojure/Meta_Data[Learning Clojure: Meta Data]
356356

357-
== ' - Quote macro
357+
== `'` - Quote macro
358358

359359
Can be used against symbols as part of a dispatch macro
360360
(see <<xref/../weird_characters#dispatch,`#`>>). Also used to quote forms
@@ -375,7 +375,7 @@ Note that ``` is available in EDN.
375375

376376
* <<xref/../../reference/special_forms#quote,Clojure Official Documentation>>
377377

378-
== ; - Comment
378+
== `;` - Comment
379379

380380
`;` is a comment. It takes all input from its starting point to the end of the
381381
line and ensures that the reader ignores it.
@@ -387,7 +387,7 @@ user=> ; this is a comment too
387387
<returns nothing>
388388
----
389389

390-
== : - Keyword
390+
== `:` - Keyword
391391

392392
`:` is the indicator for a keyword which is an interned string that provides
393393
fast comparison and lower memory overhead.
@@ -420,7 +420,7 @@ user=> (:three my-map 3) ; it can return a default if specified
420420
* <<xref/../../reference/data_structures#Keywords,Clojure Official Documentation>>
421421

422422
[[autoresolved_keys]]
423-
== +::+ - Autoresolved keyword
423+
== `::` - Autoresolved keyword
424424

425425
`::` is used to autoresolve a keyword to the current namespace:
426426
[source,clojure]
@@ -440,7 +440,7 @@ Note that `::` is not available in EDN
440440

441441
* <<xref/../../reference/reader#,Reader>>
442442

443-
== / - Namespace separator
443+
== `/` - Namespace separator
444444

445445
`/` can be the division function `clojure.core//`, but can also act as a
446446
separator in a symbol name to break apart the symbol name and the namespace it
@@ -449,7 +449,7 @@ to prevent collisions.
449449

450450
* <<xref/../../reference/reader#,Reader>>
451451

452-
== $ - Inner class reference
452+
== `$` - Inner class reference
453453

454454
Used to reference inner classes and interfaces in Java. Separates the
455455
container class name and the inner class name.
@@ -469,7 +469,7 @@ imported Java class
469469
* http://blog.jayfields.com/2011/01/clojure-using-java-inner-classes.html[Clojure: Using Java Inner Classes]
470470
* <<xref/../../reference/java_interop#,Official Documentation>>
471471

472-
== ->, +->>+ some-> cond-> as-> etc. - Threading macros
472+
== `->`, `->>`, `some->`, `cond->`, `as->` etc. - Threading macros
473473

474474
These are threading macros. Almost all of them take an initial value and
475475
*tread* this value through a number of forms. Let's imagine (for reasons unknown)
@@ -512,7 +512,7 @@ macros.
512512
* http://blog.fogus.me/2009/09/04/understanding-the-clojure-macro/[Understanding the Clojure +->+ macro]
513513

514514
[[unqote]]
515-
== ~ - Unquote macro
515+
== `~` - Unquote macro
516516

517517
See <<xref/../weird_characters#syntax_quote,```>> for additional information.
518518

@@ -538,7 +538,7 @@ various contexts
538538
* <<xref/../../macros#,Clojure Official Documentation>>
539539

540540
[[unquote_splicing]]
541-
== ~@ - Unquote splicing macro
541+
== `~@` - Unquote splicing macro
542542

543543
See <<xref/../weird_characters#syntax_quote,(```)>> and <<xref/../weird_characters#unquote,(`~`)>> for additional information.
544544

@@ -562,7 +562,7 @@ Again, this gives us a lot of power in macros.
562562
* <<xref/../../macros#,Clojure Official Documentation>>
563563

564564
[[syntax_quote]]
565-
== ` - Syntax quote
565+
== ````` - Syntax quote
566566

567567
See <<xref/../weird_characters#unquote_splicing,`~@`>> and <<xref/../weird_characters#unquote,(`~`)>> for additional information
568568
````` is the syntax quote. When used on a symbol it resolves to the symbol
@@ -605,7 +605,7 @@ are writing with it. The ``` allows this to happen.
605605
* http://aphyr.com/posts/305-clojure-from-the-ground-up-macros[Clojure from the ground up: macros]
606606
* <<xref/../../macros#,Clojure Official Documentation>>
607607

608-
== \*var-name* - Earmuffs
608+
== `\*var-name*` - Earmuffs
609609

610610
Earmuffs (a pair of asterisk bookending var names) is a *naming convention* in
611611
many LISPs used to denote *special vars*. Most commonly in Clojure this seems
@@ -620,7 +620,7 @@ and out writers for Clojure.
620620
* http://stackoverflow.com/questions/1986961/how-is-the-var-name-naming-convention-used-in-clojure[How is the var-name naming-convention used in clojure?]
621621
* http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/\*out*[Clojure API Docs]
622622

623-
== >!!, <!!, >! and <! - core.async channel macros
623+
== `>!!`, `<!!`, `>!`, and `<!` - core.async channel macros
624624

625625
These symbols are channel operations in `core.async` - a Clojure/ClojureScript
626626
library for channel based asynchronous programming (specifically http://en.wikipedia.org/wiki/Communicating_sequential_processes[CSP - Communicating Sequential Processes]).
@@ -661,7 +661,7 @@ asynchronous code from the code base.
661661
* https://github.com/clojure/core.async/wiki[core.async Wiki]
662662
* <<xref/../core_async_go#,Go Block Best Practices>>
663663

664-
== <symbol>? - Predicate Marker
664+
== `<symbol>?` - Predicate Marker
665665

666666
Putting `?` at the end of a symbol is a *naming convention* common across
667667
many languages that support special characters in their symbol names. It is
@@ -687,7 +687,7 @@ This is simply a recommended *convension*, not a *requirement*.
687687

688688
* https://github.com/bbatsov/clojure-style-guide#naming[Clojure Style Guide]
689689

690-
== <symbol>! - Unsafe Operations
690+
== `<symbol>!` - Unsafe Operations
691691

692692
https://github.com/bbatsov/clojure-style-guide#changing-state-fns-with-exclamation-mark[The Clojure style guide has this to say]:
693693

@@ -714,7 +714,7 @@ Note that the exclamation mark is often pronounced as bang.
714714

715715
* https://github.com/bbatsov/clojure-style-guide#naming[Clojure Style Guide]
716716

717-
== _ - Irrelevant var
717+
== `_` - Irrelevant var
718718

719719
When you see the underscore character used as function arguments or similar,
720720
it is a common naming convention for vars or arguments you are not interested in using.
@@ -739,7 +739,7 @@ want to print the new value every time it changes
739739
`add-watch` takes four arguments, but in our case we only really care about the
740740
last argument - the new value of the atom.
741741

742-
== #? - Standard Reader conditional
742+
== `#?` - Standard Reader conditional
743743

744744
Reader conditionals are designed to allow
745745
different dialects of Clojure to share common code. The standard reader
@@ -754,7 +754,7 @@ is `#?` and looks like this:
754754
----
755755
* <<xref/../reader_conditionals#,Reader conditonals>>
756756

757-
== #@ - Splicing Reader conditional
757+
== `#@` - Splicing Reader conditional
758758

759759
The syntax for a splicing reader conditional is `#?@`. It is used to splice
760760
lists into the containing form. So the Clojure reader would read this:
@@ -772,7 +772,7 @@ as this:
772772
----
773773
* <<xref/../reader_conditionals#,Reader conditonals>>
774774

775-
== #: Map Namespace Syntax
775+
== `#:` Map Namespace Syntax
776776

777777
Map namespace syntax was added in Clojure 1.9 and is used to specify a default
778778
namespace context for keys in the map using a `#:ns` prefix, where _ns_ is the
@@ -797,14 +797,14 @@ is read as:
797797

798798
* <<xref/../../reference/reader#map_namespace_syntax,Reader>>
799799

800-
== +#::+ Autoresolving Namespace Syntax
800+
== `#::` Autoresolving Namespace Syntax
801801

802802
`#::` can be used to auto-resolve namespaces with the same semantics as
803803
<<xref/../weird_characters#autoresolved_keys,autoresolved keywords>>.
804804

805805
* <<xref/../../reference/reader#map_namespace_syntax,Reader>>
806806

807-
== #= Reader eval
807+
== `#=` Reader eval
808808

809809
`#=` allows the reader to evaluate an arbitrary form during read time:
810810

0 commit comments

Comments
 (0)