unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Macro to prepend element to list
@ 2021-03-20 14:24 Jean Abou Samra
  2021-03-20 16:04 ` Linus Björnstam
  0 siblings, 1 reply; 5+ messages in thread
From: Jean Abou Samra @ 2021-03-20 14:24 UTC (permalink / raw)
  To: guile-user

Hello,

I find myself frequently using the following macro:

(define-macro (prepend! thing lst)
    `(set! ,lst (cons ,thing ,lst)))

Have I missed a module somewhere that does this kind of things?
At least, I couldn't find anything in SRFIs. It may also be the
case that this is too specific to certain non-functional usages
(LilyPond in my case).

Thanks in advance,
Jean Abou Samra




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-20 20:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-20 14:24 Macro to prepend element to list Jean Abou Samra
2021-03-20 16:04 ` Linus Björnstam
2021-03-20 17:05   ` Jean Abou Samra
2021-03-20 18:10     ` Linus Björnstam
2021-03-20 20:16       ` Jean Abou Samra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).