GithubHelp home page GithubHelp logo

stuarthalloway / programming-clojure Goto Github PK

View Code? Open in Web Editor NEW
596.0 596.0 140.0 27.23 MB

Sample code for the book

Home Page: http://www.pragprog.com/titles/shcloj/programming-clojure

License: Other

Clojure 91.90% CSS 1.18% Java 1.20% JavaScript 5.45% HTML 0.28%

programming-clojure's Introduction

Sample Code for Programming Clojure

http://www.pragprog.com/titles/shcloj2/programming-clojure Copyright 2011 Stuart Halloway and Aaron Bedra. All rights reserved.

Important Notice

If you are reading the first edition of the book sure you grab the first-edition branch of this project instead, from

https://github.com/stuarthalloway/programming-clojure/tree/first-edition

The first-edition branch has all the files exactly where the book says they will be.

Getting Started

  • Make sure you have Java installed.
  • Make sure you have leiningen installed.
  • Run lein deps to install all the dependent libraries.
  • Run script/repl to launch a repl.

Want more Clojure Practice?

Labrepl is a free, open-source environment for exploring the Clojure language. It includes:

  • a web application that presents a set of lab exercises with step-by-step instructions
  • an interactive repl for working with the lab exercises
  • solutions with passing tests
  • up-to-date versions of Clojure, contrib, incanter, compojure and other libraries to explore

programming-clojure's People

Contributors

abedra avatar stuarthalloway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

programming-clojure's Issues

Clojure binding not working ,is bug?

user=>(loop [x 5 result []]
(do (println x result))
(if (zero? x)
result
(recur (conj result x) (dec x) )))

------------output-----------------------------------
5 []
[5] 4
ClassCastException clojure.lang.PersistentVector cannot be cast to java.lang.Num
ber clojure.lang.Numbers.isZero (Numbers.java:92)


why?

clojure contrib issue

I'm getting:

Downloading: org/clojure/contrib/standalone/1.3.0-SNAPSHOT/standalone-1.3.0-SNAPSHOT.pom from repository clojars at http://clojars.org/repo/
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure.contrib:standalone:pom:1.3.0-SNAPSHOT' in repository clojars (http://clojars.org/repo/)
Downloading: org/clojure/contrib/standalone/1.3.0-SNAPSHOT/standalone-1.3.0-SNAPSHOT.jar from repository clojars at http://clojars.org/repo/
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojure.contrib:standalone:jar:1.3.0-SNAPSHOT' in repository clojars (http://clojars.org/repo/)
An error has occurred while processing the Maven artifact tasks.
Diagnosis:

Unable to resolve artifact: Missing:
----------
1) org.clojure.contrib:standalone:jar:1.3.0-SNAPSHOT

Try downloading the file manually from the project website.

Do I need to install it manually?

Issues and pull requests?

I'm working through the book and the examples (I'm one of the tech reviewers) and was wondering if you are interested in getting issues or pull requests on this repo, or should I just make note of things and send them in my tech. review? I'd be glad to do either.

Possible Fibo improvement (Page 95)

Wouldn't it be better to define Fibo as a simple sequence rather than a function here: https://github.com/stuarthalloway/programming-clojure/blob/master/src/examples/functional.clj#L45-L46

I mean:
(def fibo (map first (iterate (fn [[a b]] [b (+ a b)]) [0N 1N])))

This way I can "query" the data structure with
(take 10 fibo)

With the function form I am not really sure how to make it return only the first nth items.

Thanks for your book btw, I am greatly enjoying working with it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.