GithubHelp home page GithubHelp logo

clojurebook / clojureprogramming Goto Github PK

View Code? Open in Web Editor NEW
398.0 398.0 89.0 574 KB

Example projects and sample code featured in Clojure Programming (1st ed.) from O'Reilly

Home Page: http://clojurebook.com

Clojure 99.01% Java 0.99%

clojureprogramming's Issues

lein jar in ch08-lein-mixed-source fails

On commit fb44c29 of ch08-lein-mixed-source, the "lein compile" target succeeds, but the "lein jar" target fails with:

Copying 1 file to /home/clojure/src/ClojureProgramming/ch08-lein-mixed-source/lib
Compiling mixed.core
Compilation succeeded.
Compiling 1 source file to /home/clojure/src/ClojureProgramming/ch08-lein-mixed-source/classes
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at jline.ConsoleRunner.main(ConsoleRunner.java:69)
Caused by: java.lang.NullPointerException (NO_SOURCE_FILE:0)
    at clojure.lang.Compiler.eval(Compiler.java:5440)
    at clojure.lang.Compiler.eval(Compiler.java:5391)
    at clojure.core$eval.invoke(core.clj:2382)
    at clojure.main$eval_opt.invoke(main.clj:235)
    at clojure.main$initialize.invoke(main.clj:254)
    at clojure.main$script_opt.invoke(main.clj:270)
    at clojure.main$main.doInvoke(main.clj:354)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at clojure.lang.Var.invoke(Var.java:377)
    at clojure.lang.AFn.applyToHelper(AFn.java:172)
    at clojure.lang.Var.applyTo(Var.java:482)
    at clojure.main.main(main.java:37)
    ... 5 more
Caused by: java.lang.NullPointerException
    at clojure.lang.Numbers.ops(Numbers.java:1364)
    at clojure.lang.Numbers.isZero(Numbers.java:99)
    at leiningen.jar$jar.invoke(jar.clj:222)
    at leiningen.jar$jar.invoke(jar.clj:228)
    at clojure.lang.Var.invoke(Var.java:365)
    at clojure.lang.AFn.applyToHelper(AFn.java:161)
    at clojure.lang.Var.applyTo(Var.java:482)
    at clojure.core$apply.invoke(core.clj:542)
    at leiningen.core$apply_task.invoke(core.clj:264)
    at leiningen.core$_main.doInvoke(core.clj:331)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at clojure.lang.AFn.applyToHelper(AFn.java:161)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at clojure.core$apply.invoke(core.clj:542)
    at leiningen.core$_main.invoke(core.clj:334)
    at user$eval42.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:5424)
    ... 16 more

This is with LEIN_VERSION="1.7.0"

Definition of enforce-max-health in Chapter 4

The definition of "enforce-max-health" with keyword arguments does not work with the way it is called in the definition of "character". This is an error in the book (page 190) and ch04-concurrency-repl-interactions.clj. However, the version in ch04-concurrency-game/src/com/clojurebook/concurrency/game_validators.clj is correct.

lein jar in ch08-lein-mixed-source fails

On commit fb44c29 of ch08-lein-mixed-source, the "lein compile" target succeeds, but the "lein jar" target fails with:

Copying 1 file to /home/clojure/src/ClojureProgramming/ch08-lein-mixed-source/lib
Compiling mixed.core
Compilation succeeded.
Compiling 1 source file to /home/clojure/src/ClojureProgramming/ch08-lein-mixed-source/classes
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at jline.ConsoleRunner.main(ConsoleRunner.java:69)
Caused by: java.lang.NullPointerException (NO_SOURCE_FILE:0)
    at clojure.lang.Compiler.eval(Compiler.java:5440)
    at clojure.lang.Compiler.eval(Compiler.java:5391)
    at clojure.core$eval.invoke(core.clj:2382)
    at clojure.main$eval_opt.invoke(main.clj:235)
    at clojure.main$initialize.invoke(main.clj:254)
    at clojure.main$script_opt.invoke(main.clj:270)
    at clojure.main$main.doInvoke(main.clj:354)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at clojure.lang.Var.invoke(Var.java:377)
    at clojure.lang.AFn.applyToHelper(AFn.java:172)
    at clojure.lang.Var.applyTo(Var.java:482)
    at clojure.main.main(main.java:37)
    ... 5 more
Caused by: java.lang.NullPointerException
    at clojure.lang.Numbers.ops(Numbers.java:1364)
    at clojure.lang.Numbers.isZero(Numbers.java:99)
    at leiningen.jar$jar.invoke(jar.clj:222)
    at leiningen.jar$jar.invoke(jar.clj:228)
    at clojure.lang.Var.invoke(Var.java:365)
    at clojure.lang.AFn.applyToHelper(AFn.java:161)
    at clojure.lang.Var.applyTo(Var.java:482)
    at clojure.core$apply.invoke(core.clj:542)
    at leiningen.core$apply_task.invoke(core.clj:264)
    at leiningen.core$_main.doInvoke(core.clj:331)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at clojure.lang.AFn.applyToHelper(AFn.java:161)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at clojure.core$apply.invoke(core.clj:542)
    at leiningen.core$_main.invoke(core.clj:334)
    at user$eval42.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:5424)
    ... 16 more

This is with LEIN_VERSION="1.7.0"

Error in ``reduce`` example

On pg. 63 of the first edition there is an error in the first example for reduce:

(reduce max [0 -3 10 48])
;= 10

It should read 48.

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.