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
>
> It's how all Lisps, including guile, works. So, yes, if one is
> interested in these languages, this is interesting knowledge :)
>
Pierpaolo you sense of humour is tickling me :-)
i admit it is not common nowadays to set-car! or set-cdr! and my teachers
at the time i learn it
forbided it and
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:
On 03-08-2022 12:55, Damien Mattei wrote:
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
wrote:
> > scheme@(guile-user)> (define str2 "hello")
> > scheme@(guile-user)> (string-set! str2 4 #\a)
> > ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> > string is read-only: "hello"
>
> It's not -- the existence of read-only strin
er)> (define str2 "hello")
>>> scheme@(guile-user)> (string-set! str2 4 #\a)
>>> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
>>> string is read-only: "hello"
>>>
>>> Entering a new prompt. Type `,bt' for a ba
in conditions; type `,show c' for details.
>>>>
>>>> Enter `,help' for help.
>>>> scheme@(guile-user)> (define str2 "hello")
>>>> scheme@(guile-user)> (string-set! str2 4 #\a)
>>>> ice-9/boot-9.scm:1669:16: In procedure raise-e
Hi,
Am 03.08.2022 11:41 schrieb Maxime Devos:
I'm not aware of explicit documentation that string literals may not
be modified (and in this case, cannot be modified). However, see the
following mail on string mutability and program text:
R7RS has a chapter mentioning this (3.4. Storage
This program is free software, and you are welcome to redistribute it
>> under certain conditions; type `,show c' for details.
>>
>> Enter `,help' for help.
>> scheme@(guile-user)> (define str2 "hello")
>> scheme@(guile-user)> (string-set! str2 4 #
On 03-08-2022 11:51, Damien Mattei wrote:
ok
and 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
-- Forwarded message -
From: Damien Mattei
Date: Wed, Aug 3, 2022 at 11:51 AM
Subject: Re: string is read-only
To: Thomas Morley
ok
and i suppose it is the standard, i have been confused by other schemes or
racket where my code worked:
CHICKEN
(c) 2008-2019, The CHICKEN Team
(c
n conditions; type `,show c' for details.
>
> Enter `,help' for help.
> scheme@(guile-user)> (define str2 "hello")
> scheme@(guile-user)> (string-set! str2 4 #\a)
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> string is read-only: "hello"
On 03-08-2022 11:12, Damien Mattei wrote:
scheme@(guile-user)> (define str2 "hello")
scheme@(guile-user)> (string-set! str2 4 #\a)
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
string is read-only: "hello"
It's not -- the existence of read-only strings is
it
> under certain conditions; type `,show c' for details.
>
> Enter `,help' for help.
> scheme@(guile-user)> (define str2 "hello")
> scheme@(guile-user)> (string-set! str2 4 #\a)
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> string is r
@(guile-user)> (define str2 "hello")
scheme@(guile-user)> (string-set! str2 4 #\a)
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
string is read-only: "hello"
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,q
15 matches
Mail list logo