DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Day 6 - Clojure

Day 6 - Clojure

Wayne Adams user avatar by
Wayne Adams
·
Apr. 05, 11 · Java Zone · Interview
Like (0)
Save
Tweet
4.10K Views

Join the DZone community and get the full member experience.

Join For Free

Today I'm reviewing the discussion of Clojure from Bruce Tate's Seven Languages in Seven Weeks. Clojure is Lisp on the Java virtual machine. Lisp is another language that, despite being around a long time, I have yet to investigate, so this is another new experience. Bruce starts with a brief review of Lisp itself, then a quick discussion of the link between Clojure and the JVM. A discussion of Lisp functions and datatypes is followed by a view of Clojure lists, sets, maps and vectors (in Clojure, lists are typically used for data, while vectors are used for data).

Still on Day 1 of Clojure, we discuss functions, including how to pass parameters, deconstruction using bindings, and then anonymous functions. The day ends with an interview with Rich Hickey, the creator of Clojure. One interesting revelation from this interview is that a concerted effort was made to reduce the use of parentheses, to make the language more accessible to the rest of us!

Day 2 discusses recursion, including interesting syntax Clojure uses to support tail recursion (required because of the fact that Clojure runs on the JVM). Next, Bruce discusses Clojure sequences, which can be used to wrap all the Clojure collection classes (plus a few more), and functions available to operate on sequences. He discusses lazy evaluation, used to create infinite sequences. A little discussion on Java interoperability is followed by an overview of macros, used to extend the Clojure language.

Bruce's Day 3 discusses concurrency. Unlike any of the other languages discussed so far in the book, Clojure supports concurrency with an approach that is called software transactional memory, a strategy that uses multiple versions of data to avoid issues surrounding simultaneous mutation. To use this strategy, Clojure requires that all references be changed within a transaction. Following are discussions of working with atoms, agents, and futures. Bruce ends Day 3 with a list of some features of Clojure which were not covered in the book, then ends with the expected discussion of Clojure's strengths and weaknesses. 

From http://wayne-adams.blogspot.com/2011/04/day-6-clojure.html

Clojure

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Chopping the Monolith
  • How BDD Works Well With EDA
  • How to Hash, Salt, and Verify Passwords in NodeJS, Python, Golang, and Java
  • Fintech and AI: Ways Artificial Intelligence Is Used in Finance

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo