chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Replace an element in a list


From: Daniel Leslie
Subject: Re: [Chicken-users] Replace an element in a list
Date: Sat, 13 Dec 2014 18:33:37 -0800

There are setters for car and cdr, so let's say you're at a position where you want to replace the head of a list, you can then just do:

(set! (car some-list) some-value)


-Dan

On Sat, Dec 13, 2014 at 3:59 PM, Bahman Movaqar <address@hidden> wrote:
What is the idiomatic way of replacing the nth element in a list
*without* mutating the list? Is the combination of "take" and
"take-right" the right way to do it?
TIA,

--
Bahman Movaqar

http://BahmanM.com - https://twitter.com/bahman__m
https://github.com/bahmanm - https://gist.github.com/bahmanm
PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)



_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]