Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 62c2706eb6
Fetching contributors…

Cannot retrieve contributors at this time

14 lines (11 sloc) 0.614 kB
<p>Congratulations - you just defined your first Clojure function. Many more will follow!</p>
<p>
<code>defn</code> takes the name of the function, then the list of arguments, and then the body of the function.
I told you that a Clojure program is made of lists, right?
The entire <code>defn</code> is a list, and the function body is also a list.
(Even the arguments are collected in a vector, which is similar to a list - we'll talk about vectors soon).
</p>
<p>
Oh, sorry for talking so long - you probably want to try out your brand new function!
Type <code class="expr">(square 10)</code>.
</p>
Jump to Line
Something went wrong with that request. Please try again.