|
From: | Maxime Devos |
Subject: | Re: string is read-only |
Date: | Wed, 3 Aug 2022 12:59:29 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
but no restrictions with lists in Guile:scheme@(guile-user)> (define lst '(1 2 3))
scheme@(guile-user)> (set-car! lst 7)
scheme@(guile-user)> lst
(7 2 3)
Non-empty lists are pairs and the second part of the pair is another list -- in Guile, this is effectively implement as having the second part (the cdr) be a kind of pointer.
Pointers need relocation, so lists cannot be put in read-only
sections (unless something like RELRO is used), and in Guile pairs
do not have 'am I read-only' metadata (unlike strings).
Greetings,
Maxime.
OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature
[Prev in Thread] | Current Thread | [Next in Thread] |