Subject: Re: Setting keys/values in alists
From: Erik Naggum <erik@naggum.net>
Date: 30 Oct 2000 14:25:34 +0000
Newsgroups: comp.lang.lisp
Message-ID: <3181904734006098@naggum.net>

* Daniel Henrique Alves Lima <970482@tigre.dcc.unicamp.br>
| Is there any function to add/remove/update cons cells (which contain
| key/value pair) from a alist (association list, i guess) ?

  Ordinary list manipulation functions apply.

| Example :
| 
| (setq alist '((name . "John") (age . 21)))
| 
| Now i want to modify John´s age. How can i do this ?

  How do you look it up to begin with?  The general answer is to use
  setf with that form to set the new value.

|  -----------------------------------------------------------
| |          ________                                         |
| |   o     |   __   | Daniel Henrique Alves Lima , RA:970482 |
| |    _O  |  |__|  | Ciencia da Computacao 97 / Unicamp     |
| | ____/\  |___WW___| E-mail : 970482@dcc.unicamp.br         |
| | __/  /      ||                                            |
| |             ||                                            |
| |             ||                                            |
| | ____________||___________________________________________ |
|  -----------------------------------------------------------

  Drop this.

#:Erik
-- 
  Does anyone remember where I parked Air Force One?
                                   -- George W. Bush