Hi all,

I have just started reading this book, and went through the 1st Recipe:
https://www.packtpub.com/application-development/clojure-data-structures-and-algorithms-cookbook

Unfortunately, the recipe apparently does not work. On page 2, the author 
informally describes the recipe as taking:
["a" "a" "a" "b" "b" "b" "b" "b" "b" "b" "c" "c"]

and producing a "compressed" version looking like:
[3 times "a", 7 times "b", 2 times "c"]
i.e., recognizing the repetitions of characters

The code in the book (which can be downloaded after registration from the 
above site), however, produces the following:
(LZ77 ["a" "a" "a" "b" "b" "b" "b" "b" "b" "b" "c" "c"] 100)
;=> ["a" [1 1] "a" "b" [1 1] "b" [3 3] "b" "c" [1 1]]

(100 is just the size of the history window used by the compression 
function)

While I would have expected:
["a" [1 3] "b" [1 7] "c" [1 2]]

Has anyone tried the recipe and can (dis)confirm my experience?

Thanks in advance

Cheers
Gianluca

-- 
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
--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to