Reputation: 4010
I want to put the value of an empty string ""
into an empty list.
I currently have the idea of (cons "" '())
. Is there any other (or better) way to do this?
Upvotes: 1
Views: 184
Reputation: 91857
Or indeed just '("")
. list
is the more general list constructor, since it will evaluate its arguments, but for creating a list of constants, you can use quote
(recall that 'x
is shorthand for (quote x)
).
You should also consider creating a vector instead, with [""]
. Vectors are often a better place to store data than lists, in Clojure.
Upvotes: 6