Hi, I didn't test what I'll say, but it seems to me there are more than one problem: * when having in cond long conditions followed by a long expression, you should consider switching to "miser" mode by placing the expression on a new line, indented 2 characters from the condition start column * instead of (- i 1) you can use (dec i) * instead of (= i 0) you can use (zero? i) * in the for loop, I think you should not consider you can use it for binding (nth s1 (- i 1)) to xi, because it will try to convert (nth s1 (- i 1)) to a seq : at worst it will not work, at best it seems (at least to me) unclear for the reader what your intent was * by calling hash-set with the seq resulting from the for loop, don't you just end up with one element in the set, instead of the set populated with all elements of the seq ? Try (apply hash-set (for ...)) instead ? * in the third test you are adding values to the set R, you should use (conj R (...)) instead of (cons (...) R)
Regards, -- Laurent 2009/7/16 martin_clausen <martin.clau...@gmail.com> > > Can anybody give me some hints on how to translate this: > http://bit.ly/lcs_py > (the backTrackAll function) from Python into Clojure? I have a pasted > my attempt here: http://paste.lisp.org/+1SL7, but it doesn't work. For > completeness I have included the functions required to test the > traceback-all-lcs function and my traceback-lcs function (that > works :-)). > > I cannot figure out if it is the list comprehension that is wrong or > my use of cons or some immutability thing that is tricking me. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---