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 <bah...@bahmanm.com> 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
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users
>
>
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to