help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Array to list and vice versa


From: Stephen Berman
Subject: Re: Array to list and vice versa
Date: Sun, 06 Nov 2022 15:25:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

On Sun, 06 Nov 2022 13:40:26 +0000 Heime <heimeborgia@protonmail.com> wrote:

> How can I get values from an array to populate a list.

Is the array a vector or string?  Then:

(append '[1 2 3] nil)

or

(mapcar 'char-to-string "123")

> And vice versa, take a list to make an array.

To make a vector:

(vconcat '(1 2 3))

To make a string, it depends on the type of the list elements:

(mapconcat 'number-to-string '(1 2 3))
(mapconcat 'symbol-name '(a b c))

Steve Berman



reply via email to

[Prev in Thread] Current Thread [Next in Thread]