diff options
author | Rich Hickey <richhickey@gmail.com> | 2008-02-21 20:52:45 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2008-02-21 20:52:45 +0000 |
commit | 1c9de854a30e116e502c2d0bebaadce8f80219fb (patch) | |
tree | 8cabba0b169ac419031d1a93ab1c4ebf0d3e14c6 | |
parent | 268230358a78e19ba055342ddcaa8d5fd02a3a50 (diff) |
get now returns nil on non-maps
-rw-r--r-- | src/jvm/clojure/lang/RT.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/jvm/clojure/lang/RT.java b/src/jvm/clojure/lang/RT.java index 58ed95ad..22185176 100644 --- a/src/jvm/clojure/lang/RT.java +++ b/src/jvm/clojure/lang/RT.java @@ -421,7 +421,8 @@ static public Object get(Object coll, Object key){ return nth(coll, n); } - throw new UnsupportedOperationException("get not supported on this type"); + return null; + //throw new UnsupportedOperationException("get not supported on this type"); } static public Object get(Object coll, Object key, Object notFound){ @@ -441,7 +442,9 @@ static public Object get(Object coll, Object key, Object notFound){ int n = ((Number) key).intValue(); return n >= 0 && n < count(coll) ? nth(coll, n) : notFound; } - throw new UnsupportedOperationException("get not supported on this type"); + return notFound; + +// throw new UnsupportedOperationException("get not supported on this type"); } static public Associative assoc(Object coll, Object key, Object val){ |