By Chas Emerick

Clojure is a pragmatic, general-purpose language that gives expressivity rivaling different dynamic languages like Ruby and Python, whereas seamlessly profiting from Java libraries, providers, and the entire assets of the JVM surroundings. This publication is helping you examine the basics of Clojure with examples referring to it to the languages you recognize already, within the domain names and subject matters you're employed with on a daily basis. See how this JVM language can assist do away with pointless complexity out of your programming perform and open up new strategies for fixing the main tough difficulties.

Show description

Read or Download Clojure Programming: Practical Lisp for the Java World PDF

Similar object-oriented software design books

Guide to the unified process featuring UML, Java, and design patterns

The UML, or Unified Modeling Language, is the de facto normal followed by way of the thing administration staff (OMG) and by means of just about all owners of item modeling instruments. The Unified method is explicitly designed to paintings with the UML and is an entire layout procedure protecting nearly all of the lifestyles cycle of a software program product.

JBoss at Work: A Practical Guide

Together with a couple of famous open resource items, JBoss is extra a kin of interrelated prone than a unmarried monolithic software. yet, as with every software that is as feature-rich as JBoss, there are variety of pitfalls and complexities, too. such a lot builders fight with an analogous concerns whilst deploying J2EE purposes on JBoss: they've got hassle getting the numerous J2EE and JBoss deployment descriptors to interact; they've got hassle checking out tips on how to start; their tasks would not have a packaging and deployment procedure that grows with the applying; or, they locate the category Loaders complicated and do not know the way to take advantage of them, that may reason difficulties.

Object databases in practice

Myths approximately object-oriented databases are rampant. This booklet debunks them, so database directors and bosses could make educated judgements in regards to the expertise. This booklet offers finished insurance of the "pros and cons" of object-oriented databases, assisting managers and directors come to a decision even if to enforce this strong know-how.

Building Web Applications with ADO.NET and XML Web Services

Tips on how to construct a data-intensive net software with XML internet providers and ADO. internet! Richard Hundhausen, Steven Borg, Cole Francis, and Kenneth Wilcox have mixed their years of craftsmanship during this useful source to educate you ways a customary stressed enterprise can leverage net companies in B2B trade.

Extra resources for Clojure Programming: Practical Lisp for the Java World

Example text

This allows functions and libraries to be trivially composed around the data being handled with a minimum of integration, “glue code,” and other incidental complexity. One challenge when working with abstract collections is being able to concisely access multiple values in those collections. 2 Clojure provides convenience functions for accessing the first, second, and last values from a sequential collection. The nth function allows you pluck any value from a sequential collection using an index into that collection.

This sort of syntactic extension generally requires macros, which are treated in detail in Chapter 5. info 'x ;= x Any Clojure form can be quoted, including data structures. Doing so returns the data structure in question, with evaluation recursively suppressed for all of its elements: '(+ x x) ;= (+ x x) (list? '(+ x x)) ;= true While lists are usually evaluated as calls, quoting a list suppresses that evaluation, yielding the list itself; in this case, a list of three symbols: '+, 'x, and 'x.

You should prefer the shorter notation in general. 2. You can define a variadic function31 and refer to that function’s rest arguments using the %& symbol. These functions are therefore equivalent: (fn [x & rest] (- x (apply + rest))) #(- % (apply + %&)) Function literals cannot be nested. IllegalStateException: ;= Nested #()s are not allowed> Aside from the fact that the bodies of function literals are intended to be terse, simple expressions, making the prospect of nested function literals a readability and comprehension nightmare, there’s simply no way to disambiguate which function’s first argument % is referring to.

Download PDF sample

Rated 4.76 of 5 – based on 18 votes