ajmccluskey

clj-loop-recur-type-error

Oct 4th, 2014
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; CompilerException java.lang.IllegalArgumentException:  recur arg for primitive local: last_byte is not
  2. ; matching primitive, had: Object, needed: byte, compiling:...
  3.  
  4. (defn test-lr []
  5.   (loop [last-byte (byte 0)
  6.          bytez (map byte '(1 2 3 4))
  7.          answer '()]
  8.     (if (empty? bytez)
  9.       answer
  10.       (recur (first bytez)
  11.              (rest bytez)
  12.              (cons (bit-or (first bytez last-byte) answer))))))
Advertisement
Add Comment
Please, Sign In to add comment