diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/clj/clojure/gvec.clj | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/clj/clojure/gvec.clj b/src/clj/clojure/gvec.clj index 9e0f0c81..229394b6 100644 --- a/src/clj/clojure/gvec.clj +++ b/src/clj/clojure/gvec.clj @@ -204,6 +204,15 @@ (valAt [k] (.valAt this k nil)) + clojure.lang.IFn + (invoke [k] + (if (clojure.lang.Util/isInteger k) + (let [i (int k)] + (if (and (>= i 0) (< i cnt)) + (.nth this i) + (throw (IndexOutOfBoundsException.)))) + (throw (IllegalArgumentException. "Key must be integer")))) + clojure.lang.Seqable (seq [] |