guile-devel
[Top][All Lists]
Advanced

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

Re: Guile: What's wrong with this?


From: Ludovic Courtès
Subject: Re: Guile: What's wrong with this?
Date: Wed, 04 Jan 2012 23:37:37 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux)

Hi!

Mark H Weaver <address@hidden> skribis:

> For example, look at what Guile 1.8 does:
>
>   guile> (let loop ((i 0))
>            (define y "hello")
>            (display y)
>            (newline)
>            (string-set! y i #\a)
>            (loop (1+ i)))
>   hello
>   aello
>   aallo
>   aaalo
>   aaaao
>   aaaaa
>   <then an error>
>
> So you see, even in Guile 1.8, (define y "hello") didn't do what you
> thought it did.  It didn't fill y with the string "hello".  You were
> actually changing the program text itself, and that was a serious
> mistake.

Indeed, funny example!

Ludo’.




reply via email to

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