You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At one point in the tutorial, it states "Vectors and lists are sequential and ordered collections" - but the preceding example does not show anything called "lists", just vectors, maps and sets.
Maybe vectors and lists are the same thing? I don't know Clojure yet.
The text was updated successfully, but these errors were encountered:
@mindplay-dk : Following examples already nicely explained in the tutorial by @Raynes 👍 are lists:
(+ 3 3) // A list containing an operator and then operands.
(/ 10 3) // A list containing an operator and then operands.
(defn square [x] (* x x) ) //A "square" function that takes a single number and squares it. This entire defn block is a list. Here [x] is a vector while (* x x) is a list.
Coming back to your question:
NO, Vectors and Lists are not the same.
Both "Vectos" and "Lists" belong to Clojure "Collections" and all Clojure collections are immutable and persistent.
About Lists:
Lists are used for sequential processing of data items.
Lists are linked-list data structures.
(class '(1 2 3)); => clojure.lang.PersistentList
About Vectors:
Vectos are indexed by contiguous integers, meaning you can access vector items by index.
At one point in the tutorial, it states "Vectors and lists are sequential and ordered collections" - but the preceding example does not show anything called "lists", just vectors, maps and sets.
Maybe vectors and lists are the same thing? I don't know Clojure yet.
The text was updated successfully, but these errors were encountered: