2
votes

how to convert vector to list in scheme? There are almost no procedures on vector.

  '#(1 2)

There is something like car or cdr like in list? Thanks

1
"convert to string" as in "print to string", or as in "turn each number into a character with an ascii code like this number", or as in "make a string "12" from #(1 2) and I don't care about the algorithm"?Anton Kovalenko
Heh, you (almost) named the function you need in this comment.Anton Kovalenko

1 Answers

4
votes

Perhaps you mean, this?

(apply string-append
       (map number->string
            (vector->list '#(1 2))))
=> "12"

UPDATE

Ooops, you just changed the question. Then it was a lot simpler:

(vector->list '#(1 2))
=> '(1 2)