Here's how to increment all the odd numbers between indexes 1 (inclusive) and 4 (exclusive):
user> (transform [(srange 1 4) ALL odd?] inc [0 1 2 3 4 5 6 7])[0 2 2 4 4 5 6 7]Here's how to replace the subsequence from index 2 to 4 with [-1 -1 -1]:
user> (setval (srange 2 4) [-1 -1 -1] [0 1 2 3 4 5 6 7 8 9])[0 1 -1 -1 -1 4 5 6 7 8 9]
Congratulations for the spectacular work and thanks for sharing this with the world.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/XePZ-WSviso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/XePZ-WSviso/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.