|
From: | Maxime Devos |
Subject: | Re: Fwd: string is read-only |
Date: | Wed, 3 Aug 2022 11:59:39 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
okand i suppose it is the standard, i have been confused by other schemes or racket where my code worked:
It happens to work in Guile too, when you use the interpreter instead of the compiler:
scheme@(guile-user)> (eval `(let ((a ,(string-copy "foo"))) (string-set! a 0 #\b) a) (current-module))However, as implied by <https://lists.gnu.org/archive/html/guile-devel/2012-01/msg00135.html>, it's not something to rely upon. (Maybe 'eval' should make all strings it encounters in the S-exp read-only first with substring/read-only, assuming that doesn't come with a performance cost.)
$1 = "boo"
Greetings,
Maxime.
OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature
[Prev in Thread] | Current Thread | [Next in Thread] |