GNU bug report logs -
#32841
assoc-set fails with dot notation association list
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
The thread and all replies were in 2018. Six years later, in 2024, Anyone opening the up-to-date online manual still sees the old bad code there! The manual is not adjusted even though previous emails had pointed the cause and solution out!
Today, the page has a valid link of https://www.gnu.org/software/guile/manual/html_node/Alist-Example.html and still contains
6.6.20.6 Alist Example
Here is a longer example of how alists may be used in practice.
(define capitals '(("New York" . "Albany") ("Oregon" . "Salem") ("Florida" . "Miami"))) ;; What's the capital of Oregon? (assoc "Oregon" capitals) 60 ("Oregon" . "Salem") (assoc-ref capitals "Oregon") 60 "Salem" ;; We left out South Dakota. (set! capitals (assoc-set! capitals "South Dakota" "Pierre")) capitals 60 (("South Dakota" . "Pierre") ("New York" . "Albany") ("Oregon" . "Salem") ("Florida" . "Miami")) ;; And we got Florida wrong. (set! capitals (assoc-set! capitals "Florida" "Tallahassee")) capitals 60 (("South Dakota" . "Pierre") ("New York" . "Albany") ("Oregon" . "Salem") ("Florida" . "Tallahassee")) ;; After Oregon secedes, we can remove it. (set! capitals (assoc-remove! capitals "Oregon")) capitals 60 (("South Dakota" . "Pierre") ("New York" . "Albany") ("Florida" . "Tallahassee"))
ڴѧ
п
[Message part 2 (text/html, inline)]
This bug report was last modified 209 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.