Fork me on GitHub
#exercism
<
2021-09-08
>
roelof05:09:11

nice to see. Cannot wait to test it all out @porkostomus

roelof18:09:02

What is wrong here :

(ns tracks-on-tracks-on-tracks)

(defn new-list
  "Creates an empty list of languages to practice."
  []
  ())

(defn add-language
  "Adds a language to the list."
  [lang lang-list]
  (conj lang lang-list))

(defn first-language
  "Returns the first language on the list."
  [lang-list]
  (lang-list first))

(defn remove-language
  "Removes the the last language added to the list."
  [lang-list]
  (rest lang-list))

(defn count-languages
  "Returns the total number of languages on the list."
  [lang-list]
  (count lang-list))

(defn learning-list
  "Creates an empty list, adds Clojure and Lisp, removes Lisp, adds
  Java and JavaScript, then finally returns a count of the total number
  of languages."
  []
  (count-languages(add-language "Javascript"(add-language "Java"(remove-language (add-language "Lisp"(add-language "Clojure"(new-list))))))))


(learning-list)

roelof18:09:54

the test-runner says all test are green but I cannot submit. so I think there is somewhere a syntax error which the test-runner does not display

Bobbi Towers18:09:04

When I try your solution locally, I get the following error:

{
  "version": 2,
  "status": "error",
  "message": "----- Error --------------------------------------------------------------------\nType:     java.lang.ClassCastException\nMessage:  java.lang.String cannot be cast to clojure.lang.IPersistentCollection\nLocation: /home/porky/exercism/clojure-test-runner/exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj:11:3\n\n----- Context ------------------------------------------------------------------\n 7: \n 8: (defn add-language\n 9:   \"Adds a language to the list.\"\n10:   [lang lang-list]\n11:   (conj lang lang-list))\n      ^--- java.lang.String cannot be cast to clojure.lang.IPersistentCollection\n12: \n13: (defn first-language\n14:   \"Returns the first language on the list.\"\n15:   [lang-list]\n16:   (lang-list first))\n\n----- Locals -------------------------------------------------------------------\nlang:      \"Clojure\"\nlang-list: ()\n\n----- Stack trace --------------------------------------------------------------\nclojure.core/conj                          - <built-in>\ntracks-on-tracks-on-tracks/add-language    - /home/porky/exercism/clojure-test-runner/exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj:11:3\ntracks-on-tracks-on-tracks/add-language    - /home/porky/exercism/clojure-test-runner/exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj:8:1\ntracks-on-tracks-on-tracks/add-language    - /home/porky/exercism/clojure-test-runner/exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj:33:106\ntracks-on-tracks-on-tracks/add-language    - /home/porky/exercism/clojure-test-runner/exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj:8:1\n...\ntracks-on-tracks-on-tracks/count-languages - /home/porky/exercism/clojure-test-runner/exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj:23:1\ntracks-on-tracks-on-tracks/learning-list   - /home/porky/exercism/clojure-test-runner/exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj:33:3\ntracks-on-tracks-on-tracks/learning-list   - /home/porky/exercism/clojure-test-runner/exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj:28:1\ntracks-on-tracks-on-tracks                 - /home/porky/exercism/clojure-test-runner/exercises/concept/tracks-on-tracks-on-tracks/src/tracks_on_tracks_on_tracks.clj:36:1\ntracks-on-tracks-on-tracks-test            - /home/porky/exercism/clojure-test-runner/exercises/concept/tracks-on-tracks-on-tracks/test/tracks_on_tracks_on_tracks_test.clj:2:3"
}
And same result on the website

roelof18:09:33

oke, then I have to find out what is wrong here

roelof18:09:41

not on my browser

roelof18:09:26

I see this :

Bobbi Towers18:09:40

Well since you (and Erik) have been both experiencing this something funny is likely going on

roelof18:09:32

I think so, I see now on 2 challenges that all test were green and no error message and no chang to submit

roelof18:09:47

but can you help me what is wrong with my code

roelof19:09:53

and sorry no idea why that on Erik and I we do not see the error message

Bobbi Towers19:09:34

It says on line 11 you're trying to cast a string to a coll. Could the args to conj be reversed?

roelof19:09:46

yep , that was it

Bobbi Towers19:09:47

np, but why it didn't report the error is still a mystery. I'll be looking into it.

roelof19:09:33

there is a issue of that

roelof19:09:05

I suspect that the problem is a syntax error which is not displayed

roelof19:09:15

I had it now on 2 challenges

roelof19:09:36

But this one is solved and I ask mentor feedback on it

roelof19:09:45

good luck with finding out what is wrong with the error reporting

roelof20:09:18

but if I can help with testing things , just ask

Bobbi Towers20:09:30

That's much appreciated 🙂 Part of the process seems to be that we're only handling an expected subset of a nearly infinite set of possible solutions. Eventually we'll start to converge on maximum coverage.