[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string is read-only

From: Pierpaolo Bernardi
Subject: Re: string is read-only
Date: Wed, 03 Aug 2022 13:55:56 +0200

Il giorno 3 agosto 2022, alle ore 13:36, Damien Mattei 
<> ha scritto:

>On Wed, Aug 3, 2022 at 12:59 PM Maxime Devos <> wrote:
>> (My unverified hypothesis on why you aren't seeing an error here.)
>>  it would be a big change and very strange :-O if the few lines of code
>below in scheme returned an error on lists:
>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)

This is illegal scheme. The  consequences of executing it are undefined.

It's unfortunate that because of implementation limitations many schemes do not 
detect this error.

>it is interesting ,at the end of page it says too that modifying quoted
>litteral should create an error :-O

It's how all Lisps, including guile, works.  So, yes, if one is interested in 
these languages, this is interesting knowledge :)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]