Some "Thinking out loud" here...

My last concern with assoc-in & arrays has to do with how it is
currently used for maps.  The way it creates elegant nested structures
is nice, and it requires very little understanding of the current
structure of the map.

However, assoc-in has a few more constraints when dealing w/ arrays,
and the end user does have to keep track of array structure.  Granted
they have to do this anyway by the nature of arrays.  I personally
always use conj when creating a vector of vectors, so I don't se much
of a use case (Hmmm...  Sparse Matrix?  That's better as a map...).

I DO see a great use case for update-in-with working on vectors, so
maybe assoc-in-with working on vectors should be implemented simply
for symmetry.

I dunno.  That's all I've got right now.

On Feb 3, 11:03 am, Rich Hickey <richhic...@gmail.com> wrote:
> On Fri, Jan 29, 2010 at 8:53 AM, Sean Devlin <francoisdev...@gmail.com> wrote:
> > The following doesn't currently work:
>
> > user=> (assoc [] 1 :a)
> > #<CompilerException java.lang.IndexOutOfBoundsException>
>
> But this does:
>
> user=> (assoc [] 0 :a)
>
> [:a]
>
> > So I say this should be map only.
>
> I don't think so.
>
> > Also, what do you mean by your question "Where would the default go"?
> > I don't understand what you're getting at yet.
>
> Just a question of arg order.
>
> Rich

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

Reply via email to