July 2017
Intermediate to advanced
284 pages
6h 45m
English
Keywords are used much as we would use a keyword in Ruby or an enum in Java, and are prepended with a colon.
| | => :foo |
| | :foo |
Vectors give us fast positional access to their elements. They can be created by placing the elements of the vector inside of square brackets. We create a vector and name it some-keywords in the following snippet.
| | => (def some-keywords [:foo :bar :baz]) |
| | #'matters/some-keywords |
We can use first to get the first element of a vector.
| | => (first some-keywords) |
| | :foo |
In the preceding example, the actions of the reader take place behind the scenes, as part of the REPL. Let’s make things a bit more explicit by using read-string. This takes a string directly and reads it. Here, we’re using it to read ...
Read now
Unlock full access