Hi,
One shortcoming I find working with Guile is the limited number of
examples of how to use code. Consider list-set!. The only reference in
the entire Guile manual is the definition in section 6.6.9.6 List
Modification. If I google I find
https://docs.racket-lang.org/reference/pairs.html which gives me the
example (list-set '(zero one two) 2 "two") ==> '(zero one "two") which
is what I deduced from the Guile manual. If I try something similar
in Guile:
scheme@(guile-user)> (list-set! '("zero" "one" "twooooo") 2 "two")
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
In procedure set-car!: Wrong type argument in position 1 (expecting
mutable pair): ("twooooo")
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
1 (list-set! ("zero" "one" "twooooo") 2 "two")
In ice-9/boot-9.scm:
1669:16 0 (raise-exception _ #:continuable? _)
Could someone provide me with an example of how to use list-set! ?
Alternatively what I really need is how to modify a specified element
in a list.
Thanks
Mortimer