2017-09-06 14:15 GMT+02:00 Gary Trakhman <gary.trakh...@gmail.com>:

> The second to last apply argument doesn't spread args like the last slot.
>

​OK, I changed it to:
(def digits
     (apply str (map char (inclusive-range (int \0) (int \9)))))
(def hex-digits
     (str digits
          (apply str (map char (inclusive-range (int \A) (int \F))))))
(def alphanumerics
     (str  digits
           (apply str (map char (inclusive-range (int \A) (int \Z))))
           (apply str (map char (inclusive-range (int \a) (int \z))))
           ))

That does what it should. I should probably create a function for the apply
str …



> On Sep 6, 2017 8:11 AM, "Cecil Westerhof" <cldwester...@gmail.com> wrote:
>
> I have:
> (def digits
>      (apply str
>             (map char (inclusive-range (int \0) (int \9)))))
>
> and this gives:
>     "0123456789"
>
> I also have:
> (def hex-digits
>      (apply str
>             digits
>             (map char (inclusive-range (int \A) (int \F)))))
> and this gives:
>     "0123456789ABCDEF"
>
> So far so good. Then I define:
> (def alphanumerics
>      (apply str
>             digits
>             (map char (inclusive-range (int \A) (int \Z)))
>             (map char (inclusive-range (int \a) (int \z)))
>             ))
>
> but this gives:
>     "0123456789clojure.lang.LazySeq@4659426eabcdefghijklmnopqrstuvwxyz"
>
> Why does it not give:
>     "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
>
> The definition of inclusive-range:
> (defn inclusive-range
>   ([start end] (inclusive-range start end 1))
>   ([start end step]
>           (range start (inc end) step)))
>
>
-- 
Cecil Westerhof

-- 
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