From: Mark Polesky <markpolesky@yahoo.com>
To: guile-user@gnu.org
Subject: passing an alist to a procedure without making a copy?
Date: Sat, 18 Apr 2009 15:57:28 -0700 (PDT) [thread overview]
Message-ID: <484811.24959.qm@web83405.mail.sp1.yahoo.com> (raw)
(define my-alist
'((a . 1)
))
(set! my-alist (acons 'b 2 my-alist))
my-alist ==> ((b . 2) (a . 1))
(define (alist-prepend alist key value)
(set! alist (acons key value alist)))
(alist-prepend my-alist 'c 3)
my-alist ==> ((b . 2) (a . 1))
________________________________
How can I get (alist-prepend) to operate
on the original alist?
Thanks,
Mark
next reply other threads:[~2009-04-18 22:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-18 22:57 Mark Polesky [this message]
2009-04-19 1:20 ` passing an alist to a procedure without making a copy? Linas Vepstas
2009-04-19 7:30 ` r6rsguy
2009-04-19 17:35 ` Clinton Ebadi
2009-04-20 23:36 ` Neil Jerram
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=484811.24959.qm@web83405.mail.sp1.yahoo.com \
--to=markpolesky@yahoo.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).