This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara
  • Mark post as helpful
  • send pies
  • Report post to moderator
Clojure is -like Scala- a functional dialect of Java, but its basic syntax is closer to Scheme. You can get it at http://clojure.org/. Once you have extracted the jar file, start the interpreter with



and you're ready to evaluate stuff:



Code that's saved in files can be loaded by something like



Clojure question can be asked in the Incubator > Clojure forum here at JavaRanch, and there are more interesting links at BeClojurian.


An example

To start with, here's a short Clojure program that solves the first problem of Project Euler : If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.

[code=java](defn divisible-by-3-or-5 [n]
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!