Reputation: 1000
Is this just a quirk, or is there some fundamental concept that implies this?
Upvotes: 8
Views: 910
Reputation: 1484
user> (vec nil) ; => []
user> (vector nil) ; => [nil]
user> (= *1 *2) ; => false
Why should these be equal?
Upvotes: 6
Reputation: 1391
vec converts into a vector(nil becomes an empty vector) while vector creates a vector with the given elements.
(vec nil) => []
(vector nil) => [nil]
you could have entered these expressions into a repl to see their results and why they're not equal.
Upvotes: 21