arrow-left arrow-right brightness-2 chevron-left chevron-right circle-half-full facebook-box facebook loader magnify menu-down rss-box star twitter-box twitter white-balance-sunny window-close
Clojure Journey: What the (func)?
1 min read

Clojure Journey: What the (func)?

Clojure Journey is a mini-series on my experience and the fun that ensues from learning the Clojure programming language. On Day 1, I try to wrap my head around basic functions.

Functions

The first thing that threw me off was reading function calls. From

verb(argument, argument, argument) 

in Java to the following in Clojure.

(verb argument argument argument) 

After starting at it for a while and squinting a couple of times my eyes slowly started to adapt.

Arithmetic Operations

Even reading arithmetic was a bit disorienting.

Why is the + first? or perhaps What happened to my nice infix operators?

The answer is that everything in Clojure is a function, including arithmetic operations. To keep the syntax of the language uniform, Clojure trades the familiarity of infix operators for simplicity.

It's all a parens game.

TO BE CONTINUED

If you'd like to follow the fun, please follow me @voidmaindev for updates.