[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: for-each?
From: |
Pierre-Luc Gauthier |
Subject: |
Re: for-each? |
Date: |
Mon, 3 Jul 2023 08:47:40 -0400 |
Le dim. 2 juill. 2023, à 15 h 28, Valentin Petzel <valentin@petzel.at> a écrit :
> you should not use for-each in such a case. for-each is essentially a version
> of map that does not return anything.
> …the @ token to tell the parser to insert not the scheme
> object in question, but all the elements of it:
(studiously taking notes in this scheme 101 course)
> The other way would be to construct the SimultaneousMusic << ... >> directly
> in scheme:
> $(make-music 'SimultaneousMusic 'elements parts)
Thanks for the explanation Valentin. I really appreciate it.
Jean Abou Samra <jean@abou-samra.fr> writes:
> You can't — for-each is not the right tool for this. What you actually want
> is called list splicing: #@
Thanks a lot Jean. This is exactly what I needed.
David Kastrup <dak@gnu.org> a écrit :
> That has an awkward look. I'd rather use
Yes, sorry for that, I tried to MWEise my very awkward and barely
functioning part system.
> #@(ly:music-property parts 'elements)
^ Thanks, I'll keep this one in my tool box.
--
Pierre-Luc Gauthier
- for-each?, Pierre-Luc Gauthier, 2023/07/02
- Re: for-each?, Valentin Petzel, 2023/07/02
- Re: for-each?, Jean Abou Samra, 2023/07/02
- Re: for-each?, David Kastrup, 2023/07/02
- Re: for-each?,
Pierre-Luc Gauthier <=
- Re: for-each?, Lukas-Fabian Moser, 2023/07/03
- Re: for-each?, David Kastrup, 2023/07/03
- Re: for-each?, David Kastrup, 2023/07/03
- Re: for-each?, Jean Abou Samra, 2023/07/03
- Re: for-each?, David Kastrup, 2023/07/03