Clojure
5 things you should know
POZnan JUG Meetup
January 14, 2014
@zaiste
Programmer
Started Nukomeet / Organize tech events
public class StringUtils {
public static boolean isBlank(String str) {
int strLen;
if (str == null || (strLen = str.length()) == 0) {
return true;
}
}
for (int i = 0; i < strLen; i++) {
if ((Character.isWhitespace(str.charAt(i)) == false)) {
return false;
}
}
return true;
}
(defn blank? [str]
(every? #(Character/isWhitespace %) str))
Homoiconic
« Reprogram » w/ macros
2 - Functional Programming
First-class functions
Functions as datatype: passed around, returned, etc.
Laziness
Postpone the evaluation till it's needed
Referential Transparency
Pure functions by definition
3 - Immutable & Persistent Data Structures
Immutable
Easier concurrent programming
Persistent
Preserve old copies / Efficiently share structure
State
the value of an identity at a point in time
Reference Model
Clear separation between identity and value.
Clojure Trainings
1 day introduction to Clojure
Subscribe