Exception : cannot create ISeq from Long when empty list is present.. ?

88 views
Skip to first unread message

Ashish Negi

unread,
Jul 24, 2016, 3:30:27 AM7/24/16
to Clojure
I am writing a soduku solver.. Everything works but since i am interested in first solution.. when i write `first` after https://github.com/ashishnegi/joy-of-clojure/blob/master/src/joy_of_clojure/chap16_thinking_programs.clj#L58

I get

{:type java.lang.IllegalArgumentException
;; :message "Don't know how to create ISeq from: java.lang.Long"
;; :at [clojure.lang.RT seqFrom "RT.java" 542]}

though printing the argument gives me..
    ; "value: " () " class: " clojure.lang.LazySeq

at https://github.com/ashishnegi/joy-of-clojure/blob/master/src/joy_of_clojure/chap16_thinking_programs.clj#L786

Please see full stack trace at : https://github.com/ashishnegi/joy-of-clojure/blob/master/src/joy_of_clojure/chap16_thinking_programs.clj#L88

Ashish Negi

unread,
Jul 24, 2016, 3:32:52 AM7/24/16
to Clojure

James Reeves

unread,
Jul 24, 2016, 10:27:28 AM7/24/16
to clo...@googlegroups.com
"solve" is a recursive function that expects a collection of mazes to be returned. By adding "first" you change the return type, stripping off a layer each recursive call until you get integers instead of vectors.

- James

On 24 July 2016 at 08:32, Ashish Negi <thisismy...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ashish Negi

unread,
Jul 25, 2016, 6:22:36 AM7/25/16
to Clojure, ja...@booleanknot.com
Thanks James..

I will now add a vector after first..

Reply all
Reply to author
Forward
0 new messages