Maps are like dicts in Python and are a collection of key value pairs that allow you to index into the value by using the key.
conj is used to join items onto a collection. It works on multiple types of collections, but it behaves differently with different collections.
Lists being optimized for working with the head, add items to the first position.
Vectors add items to the end of the collection.
Vectors are more of a traditional list in the Python or Ruby sense. They are optimized to the indexed and to have the last element popped from the end.
You can use nth and last with lists but the performance is better with vectors because vectors can move directly to the nth index without traversing the whole collection.
Lists seem line an important collection to Clojure; especially for what I have seen put forward as classic functional programming style where lists are processed by removing the head and doing something with it and using recursion with the tail.
There is definitely more going on than meets the eye with cons. This function will construct lists from the remainder (rest) of the list.
I am not sure of all the uses for this but one of them appears to be flattening nested lists?
It also seems handy that nil past/at the end are removed.
It may take me a little hile to get used to the fact that Clojure is generally comma agnostic. You can include commas in your lists but ideomatic Clojure will generally exclude the commas between elements in a collection.
Is this because as a Lisp, everything is a collection of sorts such that commas would be everywhere?
The term keyword is a bit confusing to me. I am for whatever reason used to calling reserved words in a language, "keywords".
That is not at all what it means in Clojure. In Clojure a keyword is sort of a named token that looks like a string but it represents something. They are like symbols in Ruby.
Today, I submitted my first ever talk proposal with the encouragement and support of friends. It feels like a giant step in my career and my life.
Six months ago I wasn't sure if I would ever attend a tech conference and today I took a step that might lead to me speaking at one.
This is the first of a series of flash card like study notes that I hope to make to describe the basics of Clojure.
This one describes functions, which are at the heart of Clojure.
A function call is just a list which is wrapped in parenthesis. The first item is the name of the function.
It allows you to develop on your own machine with tests that are pre-written and available for you to run to ensure that the code functions correctly. Great TDD training.
Today I tried the Campbells k-cup Veggie Noodle Soup. It was alright. it tasted like instant soup. Luckily it didn't make the keurig coffee taste like soup.
I organized and formalized my 2016 goals today based on a series of high level goals or core values. This helped me to focus my seemingly random list of goals into something more worthwhile and attainable. Making the list was a quote that I saw today in Ash Ambrege's I hate Mondays project about geeking out rather than faking it.
The closure is one is the more interesting language features. It allows you to capture and preserve state and pass it around to other parts of the code.