start content of chapter 3

rhgraysonii authored
revision 3fb7a26bcbce6425c0caeec09e0880f99b89cf21
3_Maps_Arrays_Data_Structures_Oh_My
# More Types

## Symbols


## Booleans


## Keywords
Let's look at a symbol.

(class 'str)
;=>clojure.lang.Symbol

A symbol in Clojure is a piece that allows us to reference things locally. For our purposes there is not much more that is needed in digging into them.Their most common use is to be referred to then filled in with a value.

## Booleans
If you are familiar with program concepts in general (which you should be if reading this book) you will have heard the term 'truthiness' many times before. The 'truthiness' structure of Clojure works as follows.

(boolean false)
;=>false

(boolean true)
;=>true

(boolean nil)
;=>false

As you can see, there is little surprise here outside of nil returning false. In Ruby we would see this:

>nil
=>nil

So, we now can deduce nil evaluates to false. Now, let us look at the next thing that may catch you off guard if you come from the wonderful land of C.

(boolean 0)
;=> true

Clojure's only negative return types are nil and false. Now, we can also use our standard not, and, and or operators.

(not "pants")
;=> false;

(not nil)
;=>true

Not returns the opposite.

(and "pants" "are" "off")
;=>"off"

(and false true true false)
;=>false

And returns the first negative value, or the last one if all are truthy.

(or false "my pants are off")
;=>"my pants are off"

Or returns the first positive value.

## Keywords
Keywords are much like symbols. They contain a value to name something. They are much more useful when being paired with other data rather than operating on their lonesome. (They are just SO clingy)

(:pants)
;=>"pants"

We'll play with these rascals more once we get into maps later.


## Lists


## Vectors


## Sets


## Maps