Re: Macro to prepend element to list

2021-03-20 Thread Jean Abou Samra
Le 20/03/2021 à 19:10, Linus Björnstam a écrit : I see! To be honest, this seems like a guile-1.8ism... I don't think such code would work for guile2 though 3. Why? Because your are mutating a pointer local to your procedure, not the actual data pointed to by the music property You are modif

Re: Macro to prepend element to list

2021-03-20 Thread Linus Björnstam
I see! To be honest, this seems like a guile-1.8ism... I don't think such code would work for guile2 though 3. Why? Because your are mutating a pointer local to your procedure, not the actual data pointed to by the music property You are modifying the pointer to the list returned by the call, n

Re: Macro to prepend element to list

2021-03-20 Thread Jean Abou Samra
Le 20/03/2021 à 17:04, Linus Björnstam a écrit : Well, mutating like that is not very common, except for maybe with alists. In which situations are you mutating the list like that? Usually you would build a reverse list using a recursive function and an accumulator, which can be done without

Re: Macro to prepend element to list

2021-03-20 Thread Linus Björnstam
Well, mutating like that is not very common, except for maybe with alists. In which situations are you mutating the list like that? Usually you would build a reverse list using a recursive function and an accumulator, which can be done without set! (which has a boxing overhead). -- Linus Bjö