Clojure Maps

Clojure Maps

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.

Tagged , ,

Clojure Conj

Clojure Conj

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.

Tagged , , ,

Clojure Vectors

Clojure Vectors

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.

Tagged , , ,

Clojure Lists First Rest

Clojure Lists First Rest

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.

Tagged , , , ,

Clojure Cons

Clojure Cons

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.

Tagged , ,

Clojure Look Ma No Commas

Clojure Look Ma No Commas

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?

Tagged , , ,

Clojure Keywords

Clojure Keywords

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.

Tagged , , ,

Railsconf Talk Proposal

Railsconf Talk Proposal

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.

Tagged , , ,

Clojure Functions

Clojure Functions

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.

Tagged ,

Exploring Clojure on Exercism

Exploring Clojure on Exercism

Tonight I fired up an other Exploring Clojure hangout on air and tried out exercism.io for the first time. I had heard a lof ot really good things about it and it lived up to the hype.

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.

Tagged , , , ,

Bill v Chiefs

Bill v Chiefs

Wathcing the Chiefs v Texans game today. Not sure if I am going togo read Living Clojure instead.

Tagged , , ,

Exploring Clojure

Exploring Clojure

Today I ran an impromptu hangout on air called "Exploring Clojure" we talked about basic language constructs and worked on code at 4clojure.

Tagged , ,

K Cup O Soup Day

K Cup O Soup Day

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.

Tagged , , , ,

Codenewbie Twitter Chat

Codenewbie Twitter Chat

I have enjoyed participating in the weekly CodeNewbie Twitter chat for a while now. Another good twitter chat tonight.

Tagged , ,

High Level Goals and Core Values

High Level Goals and Core Values

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.

Tagged , , ,

Starting Clojure Today

Starting Clojure Today

Today is the first day of 2016 and two things I wouuld like to start doing this year are Daily 3x5 and learning Clojure.

The image is from the introduction of the book Living Clojure by Cairin Meier that I plan to read this year.

Tagged , , , ,

Pythonic Closures

Pythonic Closures

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.

Tagged , ,