I am loading forms from a file using slurp, read, and cons’ing them together to recursively read all forms into a collection. Then wish to pass this into scriptjure’s (js [& forms]) function, which expects a (list?), but (cons) gives me a Cons classed-object. How may I convert (class (cons 1 ‘(2 3 4 5))) to be IPersistentList? Thanks!
Share
Use
(apply list x)to create alistfrom sequencex:Alternatively, if you start with a list and then
conjforms onto it, you’ll end up with a list:No need for
consin this case sinceconj, given a list, returns a list.