On Oct 28, 6:04 pm, John Harrop <jharrop...@gmail.com> wrote:
> It always starts with the zeroth item and skips ahead however many elements
> were specified. The second argument is the n in
> "every nth item". (You can think of it as the index of the SECOND item to
> take, so (take-nth 3 foo) takes index 0 of foo, then index 3, and so on.)

Yes I agree it makes perfect sense, but I don't think the doc string
really says that. It is probably just be my obtuseness but attached is
a very minor patch which might be more clear. As to what should happen
with an argument of 0 or less - I have no idea!

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

From 4fb354475629f16065fa68bfa43f0dd5475ee891 Mon Sep 17 00:00:00 2001
From: tpratley <timothyprat...@gmail.com>
Date: Fri, 2 Oct 2009 09:53:30 +1000
Subject: [PATCH] Fixed broken test

---
 test/clojure/test_clojure/compilation.clj |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/test/clojure/test_clojure/compilation.clj b/test/clojure/test_clojure/compilation.clj
index fba781c..1d3a78a 100644
--- a/test/clojure/test_clojure/compilation.clj
+++ b/test/clojure/test_clojure/compilation.clj
@@ -38,6 +38,12 @@
 
 (deftest test-embedded-constants
   (testing "Embedded constants"
-    (are [t] (eval `(= t ~t/TYPE)))
-         Boolean Byte Character Double Float Integer Long Short))
+    (is (eval `(= Boolean/TYPE ~Boolean/TYPE)))
+    (is (eval `(= Byte/TYPE ~Byte/TYPE)))
+    (is (eval `(= Character/TYPE ~Character/TYPE)))
+    (is (eval `(= Double/TYPE ~Double/TYPE)))
+    (is (eval `(= Float/TYPE ~Float/TYPE)))
+    (is (eval `(= Integer/TYPE ~Integer/TYPE)))
+    (is (eval `(= Long/TYPE ~Long/TYPE)))
+    (is (eval `(= Short/TYPE ~Short/TYPE)))))
  
-- 
1.6.0.4


From 1da1aef4a80e63e799fd1a569d8185c20e2d0341 Mon Sep 17 00:00:00 2001
From: tpratley <timothyprat...@gmail.com>
Date: Wed, 28 Oct 2009 19:13:08 +1100
Subject: [PATCH] Trivial docstring update to take-nth

---
 src/clj/clojure/core.clj |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index 90e3f76..91f7923 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -2727,7 +2727,7 @@
   (.removeAlias (the-ns ns) sym))
 
 (defn take-nth
-  "Returns a lazy seq of every nth item in coll."
+  "Returns a lazy seq of every nth item in coll, starting at the 0th."
   [n coll]
     (lazy-seq
      (when-let [s (seq coll)]
-- 
1.6.0.4

Reply via email to