summaryrefslogtreecommitdiff
path: root/src/clj
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-08-19 21:11:42 -0400
committerRich Hickey <richhickey@gmail.com>2009-08-19 21:11:42 -0400
commit7ba336f50f32dbe9ce06ef00d1482e67341dbdb6 (patch)
treea6ada86ef5c05891c001d55409fa4880c4bd7fa4 /src/clj
parent2098f5d57ecf3affb09a4cdaf2e01ad4de861eef (diff)
inline nth with not-found
Diffstat (limited to 'src/clj')
-rw-r--r--src/clj/clojure/core.clj4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index 3974204e..4096a6ff 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -547,8 +547,8 @@
bounds, nth throws an exception unless not-found is supplied. nth
also works for strings, Java arrays, regex Matchers and Lists, and,
in O(n) time, for sequences."
- {:inline (fn [c i] `(. clojure.lang.RT (nth ~c ~i)))
- :inline-arities #{2}}
+ {:inline (fn [c i & nf] `(. clojure.lang.RT (nth ~c ~i ~@nf)))
+ :inline-arities #{2 3}}
([coll index] (. clojure.lang.RT (nth coll index)))
([coll index not-found] (. clojure.lang.RT (nth coll index not-found))))