GithubHelp home page GithubHelp logo

clojure-koans's People

Contributors

1vanbilous avatar abedra avatar adomokos avatar ajmcmiddlin avatar alexrobbins avatar blt avatar bobwilliams avatar brian-dawn avatar brymaven avatar chriscummins avatar dkinzer avatar dniemczyk avatar dsouth avatar elenam avatar ericlavigne avatar fayealephnil avatar felipeelias avatar gthb avatar hatemogi avatar ignacy avatar jaskirat avatar jeroendedauw avatar mjansen401 avatar neta-kedem avatar oemmerson avatar shtukas avatar the-frey avatar tmarble avatar trptcolin avatar wishpishh 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  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

clojure-koans's Issues

Error when running lein repl

Output when running lein repl

#<FileNotFoundException java.io.FileNotFoundException: Could not locate exec__init.class or exec.clj on classpath: >
nREPL server started on port 63301
IllegalStateException Attempting to call unbound fn: #'koan-engine.runner/exec/set-signal-handler!  clojure.lang.Var$Unbound.throwArity (Var.java:43)
reply.eval-modes.nrepl=>

Output when running lein --version

Leiningen 2.1.2 on Java 1.7.0_17 Java HotSpot(TM) Client VM

15_destructuring bug?

(meditations
  "Destructuring is an arbiter: it breaks up arguments"
  (= ":bar:foo" ((fn [[a b]] (str b a)))
         [:foo :bar])

;; ...

Problem with 15-destructuring.clj

This is for "Destructuring is an arbiter: it breaks up arguments". Double-checked with lein repl and the koans.clj, and the correct answer doesn't pass, not sure why.

Lein2 compatibility

Get lein koan working with lein2. Possibly a lein-koan repo issue, but will need looking into.

"Or very weak" filter koan is skipped

Ironically enough, the koan below is skipped over because __ technically returns a keyword and is used as the filter which lets everything through. Not sure how to resolve this one, but bringing it to your attention.

in higher_order_functions.clj

  "Or very weak"
  (= '(:anything :goes :here) (filter (fn [x] __) '(:anything :goes :here)))

Unable to resolve symbol:   in this context

When attempting koan 01, I'm getting the following error:

> lein koan run
Starting auto-runner...
Considering /Users/glen/Development/Clojure/clojure-koans/src/koans/01_equalities.clj...

Now meditate upon /Users/glen/Development/Clojure/clojure-koans/src/koans/01_equalities.clj
---------------------
Assertion failed!
java.lang.RuntimeException: Unable to resolve symbol:   in this context, compiling:(/Users/glen/Development/Clojure/clojure-koans/src/koans/01_equalities.clj:1:1)

I'm on OS X, and all dependencies are installed:

> lein deps :tree
 [koan-engine "0.2.0"]
   [fresh "1.0.2"]
   [jline "0.9.94" :exclusions [[junit]]]
 [lein-koan "0.1.2"]
 [org.clojure/clojure "1.5.0"]

It looks like the erroring bits are quite recent:
28bf698

Any ideas what's up?

24-macros / infix-better

Thanks for awesome koans, was really nice to train with them.

At 24-macros, 4th and 5th mediations are a bit hard to understand, since both meditation and referred defmacro has blanks to fill.

Conj for maps?

In 03_lists and 04_vectors conj is used to add values to a collection. In 06_maps assoc is used - should there be an example using conj as well? Conj works to add a collection->map, but I'm not sure if it's idiomatic?

1.10 error messages break the koans

1.8.0/1.9.0:

Now meditate upon 08_conditionals.clj
---------------------
Assertion failed!
clojure.lang.ExceptionInfo: You will face many decisions
(= __ (if (false? (= 4 5)) :a :b)) {:line 13}, compiling:(/home/bob/Projects/clojure-koans/src/koans/08_conditionals.clj:11:1)

1.10.0:

Now meditate upon 08_conditionals.clj
---------------------
Assertion failed!
Syntax error compiling at (/home/bob/Projects/clojure-koans/src/koans/08_conditionals.clj:11:1).

As you can see, the 1.10 error message no longer allows you to determine what to fix.

koans 19 datatypes, last meditation solution

Since I couldn't find the solution for the last meditation of the datatype koan, I checked the solution and I was a bit suprised to find only :

(str "Congratulations on your Best Picture Oscar, "
                          "Evil Alien Conquerors!")

So we shouldn't use category and recicpient here?

With auto-completion, I found this solution :

(print (str "You're really the "
                (.-category this) ", "
                recipient
                "... sorry."))

Shouldn't it be the solution here?
Do the explaination for .- syntax comes later?

Why clojure 1.2.1?

I cloned, then ran lein deps; it installed Clojure 1.2.1.

Is there a set of koans targeting 1.5.1?

Strictness

How strict do you want to be with people's answers? The fact that vectors are sequences means that I used vectors for the answers in list (I'm lazy and saved typing the quote short-hand...), and the tests still passed...

  "And construction by adding an element to the front is simple"
  (= [:a :b :c :d :e] (cons :a '(:b :c :d :e)))

I only really hit me when, in vectors.clj, I realized

  "You can create a vector in several ways"
  (= () (vec nil))

If these are disciplines to be followed, then you might want to enforce the strictness? If they are just questions to contemplate, then my leeway is probably desirable?

Final Recursion Koan Not Deep Enough

I had to crank up the input of factorial to achieve StackOverflowError on the last koan in recursion.clj

@@ -48,4 +52,4 @@
   (< 1000000000000000000000000N (factorial 1000N))

   "But what happens when the machine limits you?"
-  (< 1000000000000000000000000N (factorial 10000N)))
+  (< 1000000000000000000000000N (factorial 100003N)))

... and boom goes the dynamite.

Overhaul packaging & download process

There are 2 problems around this:

  • The shell/batch scripts in script currently depend on lein1 deps (or at least having dependencies in the lib directory)
  • Github downloads is gone, so the "easy-mode" zipfile will need an S3 bucket or something like that set up.

First run looks for a file and folder that don't exist

I have installed Java 1.7, clojure, and lein 2, and have cloned the github source. When I run 'lein koan run' for the first time, I get this exception:

java.io.FileNotFoundException: /bin/clojure-koans/target/stale/extract-native.dependencies (No such file or directory)

Indeed, there is no /target directory included with clojure-koans.

spyscope problem

Running:
lein koan run
Gives:
Could not find artifact spycope:spycope:jar:0.1.2 in central (http://repo1.maven.org/maven2/)
Could not find artifact spycope:spycope:jar:0.1.2 in clojars (https://clojars.org/repo/)
This could be due to a typo in :dependencies or network issues.

Running:
lein deps
Gives:
Could not find artifact spycope:spycope:jar:0.1.2 in central (http://repo1.maven.org/maven2/)
Could not find artifact spycope:spycope:jar:0.1.2 in clojars (https://clojars.org/repo/)
This could be due to a typo in :dependencies or network issues.

$ lein --version
Leiningen 2.1.2 on Java 1.6.0_41 Java HotSpot(TM) 64-Bit Server VM

updated to lein 2.2.0
Gives the same results

Last koan never tested in 06-maps

The closing paren for meditations comes after the second-to-last koan instead of the last one, so the last one is never reached. Pull request to correct immediately to follow.

Tests give meaningless location (FnLoaderThunk.java)

Running script/run on a fresh unzip of the 2011-04-13 download gives the following as the first failed test:

FAIL in clojure.lang.PersistentList$EmptyList@1 (FnLoaderThunk.java:31)
We shall contemplate truth by testing reality, via equality.
expected: (= __ true)
  actual: (not (= :fill-in-the-blank true))

The file location isn't (equalities.clj:1) as in the README, but rather (FnLoaderThunk.java:31) which doesn't help much at all.

My system is running:

Ubuntu 11.04

java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)

Can't do lein repl after fresh clone

  1. git clone git://github.com/functional-koans/clojure-koans.git
  2. lein repl
Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: do in this context, compiling:(/tmp/form-init4650606221399990463.clj:1:7462)
    at clojure.lang.Compiler.analyze(Compiler.java:6688)
    at clojure.lang.Compiler.analyze(Compiler.java:6625)
    at clojure.lang.Compiler.eval(Compiler.java:6931)
    at clojure.lang.Compiler.eval(Compiler.java:6916)
    at clojure.lang.Compiler.eval(Compiler.java:6917)
    at clojure.lang.Compiler.eval(Compiler.java:6916)
    at clojure.lang.Compiler.load(Compiler.java:7379)
    at clojure.lang.Compiler.loadFile(Compiler.java:7317)
    at clojure.main$load_script.invokeStatic(main.clj:275)
    at clojure.main$init_opt.invokeStatic(main.clj:277)
    at clojure.main$init_opt.invoke(main.clj:277)
    at clojure.main$initialize.invokeStatic(main.clj:308)
    at clojure.main$null_opt.invokeStatic(main.clj:342)
    at clojure.main$null_opt.invoke(main.clj:339)
    at clojure.main$main.invokeStatic(main.clj:421)
    at clojure.main$main.doInvoke(main.clj:384)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve symbol: do in this context
    at clojure.lang.Util.runtimeException(Util.java:221)
    at clojure.lang.Compiler.resolveIn(Compiler.java:7164)
    at clojure.lang.Compiler.resolve(Compiler.java:7108)
    at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7069)
    at clojure.lang.Compiler.analyze(Compiler.java:6648)
    ... 20 more
REPL server launch timed out.

I am sure I'm doing something silly.

$ lein --version
Leiningen 2.6.1 on Java 1.8.0_91 Java HotSpot(TM) 64-Bit Server VM

Could not resolve dependencies

After running for the first time:

lein koan run

I get the error:

Could not transfer artifact org.clojure:clojure:pom:1.2.1 from/to central (http://repo1.maven.org/maven2/): GET request of: org/clojure/clojure/1.2.1/clojure-1.2.1.pom from central failed
This could be due to a typo in :dependencies or network issues.
Could not resolve dependencies

koans won't run with Clojure 1.6

I've got Clojure 1.6 installed, but the koans won't run:

$ clj
Clojure 1.6.0
user=> 

$ ./script/run
Exception in thread "main" java.lang.Exception: Clojure version 1.5 or higher required., compiling:(.../koans/script/run.clj:1:30)

Not compatible with Clojure > 1.8

See exception below. This dependency is not 1.9+ compatible. The easy fix is to change project.clj to require clojure 1.8.

$ lein repl
Exception in thread "main" Syntax error macroexpanding clojure.core/ns at (spyscope/core.clj:1:1).
Call to clojure.core/ns did not conform to spec.
	at clojure.lang.Compiler.checkSpecs(Compiler.java:6971)
	at clojure.lang.Compiler.macroexpand1(Compiler.java:6987)
	at clojure.lang.Compiler.macroexpand(Compiler.java:7074)
	at clojure.lang.Compiler.eval(Compiler.java:7160)
	at clojure.lang.Compiler.load(Compiler.java:7635)
	at clojure.lang.RT.loadResourceScript(RT.java:381)
	at clojure.lang.RT.loadResourceScript(RT.java:372)
	at clojure.lang.RT.load(RT.java:463)
	at clojure.lang.RT.load(RT.java:428)
	at clojure.core$load$fn__6824.invoke(core.clj:6126)
	at clojure.core$load.invokeStatic(core.clj:6125)
	at clojure.core$load.doInvoke(core.clj:6109)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5908)
	at clojure.core$load_one.invoke(core.clj:5903)
	at clojure.core$load_lib$fn__6765.invoke(core.clj:5948)
	at clojure.core$load_lib.invokeStatic(core.clj:5947)
	at clojure.core$load_lib.doInvoke(core.clj:5928)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$load_libs.invokeStatic(core.clj:5985)
	at clojure.core$load_libs.doInvoke(core.clj:5969)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$require.invokeStatic(core.clj:6007)
	at clojure.core$require.doInvoke(core.clj:6007)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at koan_engine.runner$eval1794.invokeStatic(form-init3956627785839174025.clj:1)
	at koan_engine.runner$eval1794.invoke(form-init3956627785839174025.clj:1)
	at clojure.lang.Compiler.eval(Compiler.java:7176)
	at clojure.lang.Compiler.eval(Compiler.java:7165)
	at clojure.lang.Compiler.load(Compiler.java:7635)
	at clojure.lang.Compiler.loadFile(Compiler.java:7573)
	at clojure.main$load_script.invokeStatic(main.clj:452)
	at clojure.main$init_opt.invokeStatic(main.clj:454)
	at clojure.main$init_opt.invoke(main.clj:454)
	at clojure.main$initialize.invokeStatic(main.clj:485)
	at clojure.main$null_opt.invokeStatic(main.clj:519)
	at clojure.main$null_opt.invoke(main.clj:516)
	at clojure.main$main.invokeStatic(main.clj:598)
	at clojure.main$main.doInvoke(main.clj:561)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.main.main(main.java:37)
Caused by: clojure.lang.ExceptionInfo: Call to clojure.core/ns did not conform to spec. {:clojure.spec.alpha/problems [{:path [], :reason "Extra input", :pred (clojure.spec.alpha/cat :attr-map (clojure.spec.alpha/? clojure.core/map?) :ns-clauses :clojure.core.specs.alpha/ns-clauses), :val ((require [clojure.pprint :as pp] [clojure.string :as str] [clj-time.core :as time] [clj-time.format :as fmt])), :via [:clojure.core.specs.alpha/ns-form], :in [2]}], :clojure.spec.alpha/spec #object[clojure.spec.alpha$regex_spec_impl$reify__2509 0x4e93dcb9 "clojure.spec.alpha$regex_spec_impl$reify__2509@4e93dcb9"], :clojure.spec.alpha/value (spyscope.core "This co" (require [clojure.pprint :as pp] [clojure.string :as str] [clj-time.core :as time] [clj-time.format :as fmt])), :clojure.spec.alpha/args (spyscope.core "This co" (require [clojure.pprint :as pp] [clojure.string :as str] [clj-time.core :as time] [clj-time.format :as fmt]))}
	at clojure.spec.alpha$macroexpand_check.invokeStatic(alpha.clj:705)
	at clojure.spec.alpha$macroexpand_check.invoke(alpha.clj:697)
	at clojure.lang.AFn.applyToHelper(AFn.java:156)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.lang.Compiler.checkSpecs(Compiler.java:6969)
	... 43 more

Provide a way to run other 'sets' of koans

The model of koans is excellent. But I would really like to develop other 'sets' of koans that are independent of the core koans.

For example, I would like to be able to create a new directory of koans, src/my_new_set_of_koans with it's own resources/my_new_set_of_koans.clj.

In fact a 'plugin' model of sorts may be even more interesting. So, separating the koan runner from the koan provider.

Something that Says "You're Right!"

First of all, this whole project is really awesome. I'm still a beginner with using clojure, and I'm still on the early stages of these koans. It's great though.

There's just something I don't like about how once I get one koan right, there is no indication that it's right other than a different looking error. I just feel like I really have to squint to read the error and then think about it and then it's like ok, that last answer was actually right.

Idk. It would be nice to have some type of reward, high five, positive reinforcement type thing so I can pause and do a celebration and then start with the next failing test. Some kind of hook maybe that prints out a message the first time a test is passed. Just an idea.

10 Lazy Sequences - "Iteration can be used for repetition" not clear

Before "Iteration can be used for repetition," a step should be added that introduces the concept of iterator partials. As it stands, this step cannot be completed by a clojure neophyte (like myself) without diving into the documentation, which seems to run contrary to the clojure koans process.

Contributing section in README needs an update

Because of the koan-engine changes, the second paragraph should now read

The file `ideaboard.txt` has lots of good ideas for new koans to start,
or things to add to existing koans. So write some fun exercises,
add your answers to `resources/koans.clj`, and we'll get them in there!

Readme should link to the releases

In the Readme file under Getting Started it is suggested to download the zip. This links to where Version 0.4.6 from 2012 is the newest zip. It should probably link to the releases with 0.5 available.

Issue running

I am unable to run koan.
Here is what is returned when I run "java -version":
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.2) (7u65-2.5.2-3~14.04)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

This is the output when I run "lein koan run":
Copying 4 files to /home/jasoon/git/clojure-koans/.lein-plugins
Exception in thread "main" java.io.FileNotFoundException: Could not locate leiningen/core/main__init.class or leiningen/core/main.clj on classpath: (koan.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:5441)
at clojure.lang.Compiler.eval(Compiler.java:5416)
at clojure.lang.Compiler.load(Compiler.java:5858)
at clojure.lang.RT.loadResourceScript(RT.java:340)
at clojure.lang.RT.loadResourceScript(RT.java:331)
at clojure.lang.RT.load(RT.java:409)
at clojure.lang.RT.load(RT.java:381)
at clojure.core$load$fn__4519.invoke(core.clj:4915)
at clojure.core$load.doInvoke(core.clj:4914)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:4729)
at clojure.core$load_lib.doInvoke(core.clj:4766)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:542)
at clojure.core$load_libs.doInvoke(core.clj:4800)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:542)
at clojure.core$require.doInvoke(core.clj:4881)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at leiningen.core$resolve_task.invoke(core.clj:208)
at leiningen.core$apply_task.invoke(core.clj:258)
at leiningen.core$_main.doInvoke(core.clj:329)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:332)
at user$eval73.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5425)
at clojure.lang.Compiler.eval(Compiler.java:5392)
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:482)
at clojure.lang.Var.invoke(Var.java:381)
at clojure.lang.AFn.applyToHelper(AFn.java:178)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
Caused by: java.io.FileNotFoundException: Could not locate leiningen/core/main__init.class or leiningen/core/main.clj on classpath:
at clojure.lang.RT.load(RT.java:412)
at clojure.lang.RT.load(RT.java:381)
at clojure.core$load$fn__4519.invoke(core.clj:4915)
at clojure.core$load.doInvoke(core.clj:4914)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:4729)
at clojure.core$load_lib.doInvoke(core.clj:4766)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:542)
at clojure.core$load_libs.doInvoke(core.clj:4800)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:544)
at clojure.core$use.doInvoke(core.clj:4892)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at leiningen.koan$eval99$loading__4414__auto____100.invoke(koan.clj:1)
at leiningen.koan$eval99.invoke(koan.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:5425)
... 37 more
Help would be greatly appreciated!
Jason

Repl namespace issue

Something is wrong in the namespace setup (I think).

--> lein repl
nREPL server started on port 49447 on host 127.0.0.1 - nrepl://127.0.0.1:49447
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_121-b13
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

koan-engine.runner=> (string/join '(1 2 3))
Syntax error compiling at (form-init1178655580028819709.clj:1:1).
No such namespace: string

The koans themselves run successfully. This is MacOS. Sorry if I'm doing something dumb.

[feature] Extract Koan Engine?

Hey guys,

First off, this project kicks ass. I'm one of the committers on https://github.com/nathanmarz/cascalog (along with @nathanmarz), where we struggle daily to help people over that initial conceptual wall.

clojure-koans does this so well that I can't help but think that its structure would be immensely helpful to Cascalog (and really any of the more taxing clojure libraries out there.) Cascalog-Koans, core.logic-koans; all would be excellent companion libraries.

Do you guys have any thoughts on the the idea of extracting the clojure-koan structure, meditations macro etc out into a project or template that could be used by others? I'd be happy to take a crack at this if you're open to it, but don't want to do anything without a blessing and guidance.

Cheers,
Sam

Unable to resolve symbol

When I try the following kata:

"Symbolism is all around us"
(= 'foo (symbol foo))

I get this error:

Now meditate upon [...]clojure-koans/src/koans/01_equalities.clj
---------------------
Assertion failed!
java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:([...]clojure-koans/src/koans/01_equalities.clj:30:11)

p1__1085# output appearing for functions.clj

Hey Colin,

I'm noticing some unusual output coming from the functions.clj koans. Particularly, the koans that use the % syntax:

  "Or using even shorter syntax"
  (= 30 (#(* 15 %) 2))
Problem in /Users/skim/local/git/clojure-koans/src/koans/functions.clj
---------------------
Assertion failed!
Or using even shorter syntax
(= __ ((fn* [p1__1085#] (* 15 p1__1085#)) __))

Not sure if you're aware of it or not, but thought I'd bring it up. Cheers!

Keep getting "namaste" while editing a koan.

Steps to reproduce:

  1. Start script/run
  2. Open file in emacs
  3. Edit a line (without saving)

As long as the file is open and modified, but unsaved, the (namaste) function is called at every refresh step. Emacs creates a lock file called .#<koan>.clj, which confuses the runner.

It should be possible to make the runner ignore hidden files.

maps question never fails

The test for "You may not be able to find an entry for a key" doesn't fail because the correct answer is nil.

Running koans with lein 2

Using the instructions from the README here and at the clojurekoans website, I wasn't able to get them running until I noticed in the project.clj the lein-koans plugin and read its docs. I think the issue is with lein 2 and the run script; it expects to find the clojure lib in ./lib but lein deps doesn't populate the lib directory any more. Should the instructions be updated?

Thanks.

Koans for testing, Koans for agents

I think it would be nice to add Koans for generative tests with tests.generative after the metadata koans, and event-driven agent koans after the other reference type koans.

What do we think about such a thing? Should I go write some up? I'm planning on using Stuart Halloway's "Programming Clojure" as inspiration for the docstrings and pathology of ideas.

Stack overflows not reported?

In recursion.clj depending on how the user implements (defn factorial [n] &body), they may trigger a stack overflow.

The test runner, however, doesn't seem to report these stack overflows, but just returns an assertion error.

Can we report stack overflows when they arise?

Sample bad implementation:

(defn factorial [n]                                                                                                                   
  (if (= n 0)                                                                                                                               
    1                                                                                                                                       
    (* n (factorial (dec n)))))

README install options are too complicated

There should be exactly two blessed ways to run the koans. Using lein 2 is a good idea to get people a good REPL and have them ready to actually do things when they're done w/ the koans. But there's also a lot of value in the easy zipfile-based approach where you just download, unzip, and go.

Calling those 2 paths out specifically would probably help, so people can follow one thread rather than searching for their option in every section.

Strict description of the rules

It's not clear whether I am only allowed to touch the ___ parts of code in order to make tests pass or can I make changes outside ___ too?
For instance this test from destructuring seems pretty hard to solve if I'm only allowed to touch the ___ part.:

  "All together now!"
  (= "Test Testerson, 123 Test Lane, Testerville, TX"
     (___ ["Test" "Testerson"] test-address)))

13_creating_functions.clj (has a bug?)

"Don't forget: first things first"
  (= [__ __ __ __]
       (let [ab-adder (partial concat [:a :b])]
       (ab-adder [__ __])))

Using http://clojurescript.net/ REPL
that expression returns an Array (:a :b __ __),
and not a Vector [:a :b __ __] as it is stated in the koan (ab-adder [__ __ __ __])

clojure.core/concat documentation

It would be a Vector if we add into []:

(into [] (concat [:a :b] ["a" "b"]))

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.