--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
“The Vector class implements a growable array of objects. Like an array, it contains components that can be accessed using an integer index. However, the size of a Vector can grow or shrink as needed to accommodate adding and removing items after the Vector has been created.”
For people with a C/Java-style background, array typically designates a contiguous piece of memory that has been allocated at once, is thus fixed-size, and can be accessed randomly (i.e. by index). Vectors are typically structures or objects at a higher level, that still present a random-access collection, but can also for example change size.With that Background, Clojure's choice makes perfect sense. Please also consider that Clojure does not use vector instead of array, but in addition to; see make-array, geta, seta, et al.
I have no idea about the official reason, but outside of certain programming languages that use "array" for one-dimensional data structures, an array often has two (or more) dimensions. In R, for example, arrays can have an arbitrary number of dimensions. Honestly, when I'm away from Java for a while and then encounter the term "array" in Java, I have to stop and remember that it's 1-D, or check some documentation, because "array" doesn't automatically mean 1-D to me.--
On the other hand, I believe that vectors are always one-dimensional, as in linear algebra.
So maybe Rich Hickey just decided that "vector" was a better, less ambiguous name.
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
I always assumed it was because vectors have similar properties to the classic java.util.Vector
: they’re variable-length, contain heterogenous objects accessible by integer index, and safe for concurrent access from multiple threads: http://docs.oracle.com/javase/7/docs/api/java/util/Vector.html
e
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
Common Lisp also has multi dimensional arrays and one - dimensional vectors. I believe Rich was pretty familiar with that language in a former life
http://clhs.lisp.se/Body/t_array.htm