[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Array to list and vice versa
From: |
Heime |
Subject: |
Re: Array to list and vice versa |
Date: |
Sun, 06 Nov 2022 14:40:26 +0000 |
------- Original Message -------
On Sunday, November 6th, 2022 at 2:25 PM, Stephen Berman
<stephen.berman@gmx.net> wrote:
> 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:
The array is made up of numbers. [3 2 2 1 0]
> (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))
Thus, a vector looks like an ordinary list?
> 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