Using what we have just learnt from Clojure Collections, lets define ourselves in more detail using a vector type of collection.
Create a vector using [ ]
around one or more values.
[1 2 3 4]
["Its" true "Vectors" "can" "hold" 0 "or" "greater" "values"]
A vector is a very flexible box you can put any kind of values in (eg. strings, numbers, characters, function calls, names, true, false, keywords).
There is no limit to the number or types of values you can put into a vector (although an infinite number of values could prove tricky all at once)
You can also create a a vector using the function vector
(vector 1 2 3 4)
Previously you used a string to define information about yourself. Now lets create a string for each piece of information about yourself
Using a Vector of Strings and numbers to define yourself
xxxxxxxxxx
11[]
x1the evaluation will appear here (soon)...
Give the collection a name using the def
function.
By giving a vector a name, we can return the value of that vector by using its name.
xxxxxxxxxx
11(def my-details )
2
3my-details
xxxxxxxxxx
11the evaluation will appear here (soon)...
Here is a suggested example