start content of chapter 3

rhgraysonii authored
revision c2978272f504412749cb476fd2dd2ac6e1b546f1
# More Types

## Symbols
Let's look at a symbol.

(class 'str)

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)

(boolean true)

(boolean nil)

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


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)

Not returns the opposite.

(and "pants" "are" "off")

(and false true true 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)


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

## Lists
Lists are the most integral building block of any lisp.

'("my pants are off" 9999 "hashtag coding")
;=>("my pants are off" 9999 "hashtag coding")

We also can use the keyword 'list'. It is your call.

(list "my" "pants" "are" "missing")
;=>("my" "pants" "are" "missing")

We can compare lists. It happens as you may expect.

(= '("my pants are off")("my pants are off"))

We can add to them using the conjoin command, as well.

(conj '("pants" "are off") "my")
;=>("my" "pants" "are off")

Much like in other languages, we can call first on a list.

(first ("dance" "sing" "eat" "sleep" "die")

## Vectors

## Sets

## Maps