Many tutorials are old and have outdated installation paths and environment hacks. I am sure these instructions will suffer no worse the ravages of time. However they worked at the time of this writing.
Terms
REPL
LEIN
MAP
VECTOR
Install
Clojure can be run in Windows (with or without Cygwin), OS X, and Linux. Do yourself a favor and create an Ubuntu partition on your machine. I am using Ubuntu 13.10.
https://www.codeschool.com/code_tv/getting-started-with-clojure-part-2
http://doc.ccw-ide.org/documentation.html
Terms
REPL
LEIN
MAP
VECTOR
Install
Clojure can be run in Windows (with or without Cygwin), OS X, and Linux. Do yourself a favor and create an Ubuntu partition on your machine. I am using Ubuntu 13.10.
- Update Ubuntu OS
- Install Current Java JRE
- Install Java Clojure library. I use apt-get leiningen to install clojure 1.4, lein, and Leiningen.
- Unfortunately 1.4 was not the current version of Clojure. So I needed to Download and unzip the Clojure jar. <<NEEDS WORK>> I opened a command line cd to the directory in which I have my clojure fines (cd /usr/share/maven-repo/org/clojure/clojure) expanded clojure jar
java -cp clojure-1.6.0.jar clojure.main
- Install Eclipse Java EE IDE. Using apt-get Eclipse was a terrible idea. The version of the package available through apt-get is very old. Get the tar ball for Kepler or the highest version supported by the Clojure community.
- Make sure you can see the Eclipse Help menu. If you cannot, edit the Eclipse shortcut properties to use the command: env UBUNTU_MENUPROXY=0 /usr/lib/eclipse/eclipse
- Using the Eclipse Market place from the Help menu, install the counterclockwise extension. This provides a Clojure perspective.
-
Pick an Emacs, install it. Everyone uses emacs
-
Install ELPA
-
Use ELPA to install the Emacs support for Clojure
-
Install Leiningen
- Check project out of source control, use Lein to build it and run Swank, connect to that from Emacs.
https://www.codeschool.com/code_tv/getting-started-with-clojure-part-2
http://doc.ccw-ide.org/documentation.html
References
Leiningen, a Clojure project build tool you will inevitably use to some extent.
http://code.google.com/p/counterclockwise/
https://github.com/technomancy/emacs-starter-kit
https://www.eclipse.org/downloads/
Leiningen, a Clojure project build tool you will inevitably use to some extent.
http://code.google.com/p/counterclockwise/
https://github.com/technomancy/emacs-starter-kit
https://www.eclipse.org/downloads/
Don't use SourceForge nor Google Code
http://clojure.org/
Disorganized notes from JP meeting
Nike uses scala?!
Nike uses scala?!
(def tax-payer(
:first
"Eric"
:last
"Ald"
))
Jvm RUNNING THE
CLOSURE source generates classes at run time.. Or as read eval print loop
(REPL) can modify code as being executed?
Keyword type ,
starts with : make good keys on maps. A kind of function that can make all
kinds of inputs and reduces the potential outputs…
Nil in closure =
null in c#
[1,2,3,
"word", :base] this is a
vector, like anarray or tuple…
Supports dynamic
types..
Get - get values out
of a map
Idiomatic closure
(how to pass key words and map as function..also pass map object as function)
'(1,2,3)
See that single
quote, it makes this just a data set not evaluated
Pst - REPL stack
trace
You can filter the
exception report by writing your own library
Network REPL in
production using a TCP/IP connection to allow real time live debugging!
Operator precedence
rules…none in clojure as there are no operators because all is functions
Defn define new
function
Sample map
{
:rank :ace
:suit :club
}
(defn points [rank]
(case))
(points (:rank
flip-card))
Thread first macro….
(--> flip-card
:rank
points)
Thread first/thread
last macros
Let word..local
symbols/variables
First, rest, next
First - first in
collection
Rest remaining
exclude nil
Next remaining or
nil
Clojure conventions
(isTrue? Is acceptable name)
#(= first-suit %)
Cond - eval a condtion, like an if/then
Empty list is a
false value as does nil, but nil and empty list are different values so you
need to test for both conditions
Iterate - take a
function set and create new sets from them
Iterate first
(1,2,3)
first (1,2,3)
first (2,3)
first (3)
first ()
Does this work like
it did with iterate rest?
Macros and functions
live in the same name space during execution, macros are extensions
Mapping functions
over collections
Macro expansion
expands macro code down to byte code…special forms
Macros take parms
What does ~
represent in a macro..instance of a parm t be used later
Self Defined macros
are increase complexity of debugging code
Clojars and
leiningin --- distro
Lighttable IDE
Nightcode---mac
only?
4clojure learning
site vs clojure koans
Cognicast broabcast
learning
Look at datonic non
sql database that goes with this
Ring compojure - web
crap
Code.test specj ,
clojure.test- testing frameworks
No comments:
Post a Comment