万本电子书0元读

万本电子书0元读

顶部广告

Clojure for Java Developers电子书

售       价:¥

3人正在读 | 0人评论 9.8

作       者:Eduardo Díaz

出  版  社:Packt Publishing

出版时间:2016-02-23

字       数:65.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Transition smoothly from Java to the most widely used functional JVM-based language – ClojureAbout This BookWrite apps for the multithreaded world with Clojure’s flavor of functional programmingDiscover Clojure’s features and advantages and use them in your existing projectsThe book is designed so that you’ll be able put to use your existing skills and software knowledge to become a more effective Clojure developerWho This Book Is ForThis book is intended for Java developers, who are looking for a way to expand their skills and understand new paradigms of programming. Whether you know a little bit about functional languages, or you are just getting started, this book will get you up and running with how to use your existing skills in Clojure and functional programming.What You Will LearnUnderstand the tools for the Clojure world and how they relate to Java tools and standards (like Maven)Learn about immutable data structures, and what makes them feasible for everyday programmingWrite simple multi-core programs using Clojure’s core concepts, like atoms, agents and refsUnderstand that in Clojure, code is data, and how to take advantage of that fact by generating and manipulating code with macrosLearn how Clojure interacts with Java, how the class loaders work and how to use Clojure from Java or the other way aroundDiscover a new, more flexible meaning of polymorphism and understand that OOP is not the only way to get itIn DetailWe have reached a point where machines are not getting much faster, software projects need to be delivered quickly, and high quality in software is more demanding as ever.We need to explore new ways of writing software that helps achieve those goals. Clojure offers a new possibility of writing high quality, multi-core software faster than ever, without having to leave your current platform.Clojure for Java developers aims at unleashing the true potential of the Clojure language to use it in your projects. The book begins with the installation and setup of the Clojure environment before moving on to explore the language in-depth. Get acquainted with its various features such as functional programming, concurrency, etc. with the help of example projects. Additionally, you will also, learn how the tooling works, and how it interacts with the Java environment.By the end of this book, you will have a firm grip on Clojure and its features, and use them effectively to write more robust programs.Style and approachAn easy to follow, step-by-step, guide on how to start writing Clojure programs making use of all of its varied features and advantages. As this is a new language, certain new concepts are supported with theoretical section followed by simple projects to help you gain a better understanding and practice of how Clojure works.
目录展开

Clojure for Java Developers

Table of Contents

Clojure for Java Developers

Credits

About the Author

About the Reviewer

www.PacktPub.com

eBooks, discount offers, and more

Why subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Piracy

Questions

1. Getting Started with Clojure

Getting to know Clojure

Installing Leiningen

Using a REPL

The nREPL protocol

Hello world

REPL utilities and conventions

Creating a new project

Project structure

Creating a standalone app

Using Cursive Clojure

Installing Cursive Clojure

Getting started with Clojure code and data

Lists in Clojure

Operations in Clojure

Functions in Clojure

Clojure's data types

Scalars

Collection data types

Summary

2. Namespaces, Packages, and Tests

Namespaces in Clojure

Packages in Clojure

The classpath and the classloader

Back to Clojure namespaces

Playing with namespaces

Creating a new namespace

Working with namespaces on the REPL

Testing in Clojure

Testing from the command line

Testing in IntelliJ

Summary

3. Interacting with Java

Using Maven dependencies

Clojure interop syntax

Creating an object

Calling an instance method

Calling a static method or function

Accessing inner classes

Writing a simple image namespace

Writing the tests

The let statement

Destructuring in Clojure

Sequential destructuring

Associative destructuring

Exposing your code to Java

Testing from Groovy

Proxy and reify

Summary

4. Collections and Functional Programming

Basics of functional programming

Persistent collections

Types of collections in Clojure

The sequence abstraction

Specific collection types in Clojure

Vectors

Lists

Maps

Sorted maps and hash maps

Common properties

Sets

Sorted sets and hash sets

Common properties

Union, difference, and intersection

Applying functional programming to collections

The imperative programming model

The functional paradigm

Functional programming and immutability

Laziness

Summary

5. Multimethods and Protocols

Polymorphism in Java

Multimethods in Clojure

Keyword hierarchies

isa?

parents

descendants

underive

A la carte dispatch functions

Protocols in Clojure

Records in Clojure

Summary

6. Concurrency

Using your Java knowledge

The Clojure model of state and identity

Promises

Pulsar and lightweight threads

Futures

Software transactional memory and refs

Atoms

Agents

Validators

Watchers

core.async

Why lightweight threads?

Goblocks

Channels

Transducers

Summary

7. Macros in Clojure

Lisp's foundational ideas

Macros as code modification tools

Modifying code in Java

Modifying code in Groovy

The @ToString annotation

The @TupleConstructor annotation

The @Slf4j annotation

Writing your first macro

Debugging your first macro

Quote, syntax quote, and unquoting

Unquote splicing

gensym

Macros in the real world

References

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部