[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making a list of lists
From: |
uzibalqa |
Subject: |
Re: Making a list of lists |
Date: |
Mon, 03 Jul 2023 17:51:42 +0000 |
------- Original Message -------
On Tuesday, July 4th, 2023 at 4:44 AM, Sebastian Miele <iota@whxvd.name> wrote:
> > From: uzibalqa uzibalqa@proton.me
> > Date: Mon, 2023-07-03 16:41 +0000
> >
> > Suppose I have mylist, with a number of lists constructed as follows
> >
> > (setq mylist '())
> > (setq entry1 (linseq "A" "B" "C"))
> > (setq entry2 (linseq "D" "E" "F"))
> >
> > Then how do I add entry1 and entry2, to mylist ?
>
>
> Examples:
>
> (setq mylist (cons entry1 (cons entry2 mylist)))
> (push entry2 mylist) (push entry1 mylist)
> (add-to-list 'mylist entry2) (add-to-list 'mylist entry1)
> (setq mylist `(,entry1 ,entry2 ,@mylist))
Can push be used with multiple entries ?
(push entry1 entry2 mylist)
I would like to write a function that pushes a whole list to a list, to make
a list of lists, called a chart.
Here is my function, but need some form of loop, to traverse all the function
arguments.
(defun linseq (&rest sequence)
sequence)
(defun attach (chart &rest linsq)
(apply #'push linsq chart))