gL wrote:
> The solution only works with a var name that equals to a Clojure name
> (here "max").

That's because (binding) only works with a var that already exists, it 
doesn't create a new one.  To create your own var (instead of abusing a 
clojure core one) just use "with-local-vars" instead of "binding" and 
"var-set" instead of "set!".  But generally it's much easier to do it in 
a functional way making using of lazy sequence functions.

> How do you access an element  at a given place in a lazy sequence in a
> more idiomatic way?

(nth (lex-permutations [0 1 2 3 4 5 6 7 8 9]) 999999)

[Indexing starts at 0 so we use 999999 instead of 1000000.]

Cheers,

Alex

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

Reply via email to