[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (declare (pure ...))
From: |
Peter Bex |
Subject: |
Re: (declare (pure ...)) |
Date: |
Sat, 10 Feb 2024 13:30:28 +0100 |
On Sat, Feb 10, 2024 at 12:24:36PM +0000, Pietro Cerutti wrote:
> This is not how I reason about referential transparency. It is a property of
> functions applied to values, not variables.
> The fact that you can define x to different values or even rebind it in the
> scope of a let binding doesn't make (lambda (x) (+ x 1)) less referentially
> transparent.
> If you change the value of a slot of a vector, then the vector has a
> different value than before, even if the same name binds to the value.
This might be true in an abstract sense, but it isn't true for the
CHICKEN type system. The same vector (e.g. eq? returns #t) is always
the same "value", for purposes of the type system.
It can have different values inside its slots, which is why we have
to differentiate between pure and clean functions (see my other mail).
Cheers,
Peter
signature.asc
Description: PGP signature
- Re: (declare (pure ...)), (continued)
- Re: (declare (pure ...)), Pietro Cerutti, 2024/02/10
- Re: (declare (pure ...)), Al, 2024/02/10
- Re: (declare (pure ...)), Pietro Cerutti, 2024/02/10
- Re: (declare (pure ...)), Al, 2024/02/10
- Re: (declare (pure ...)), Pietro Cerutti, 2024/02/10
- Re: (declare (pure ...)), Al, 2024/02/10
- Re: (declare (pure ...)), Pietro Cerutti, 2024/02/10
- Re: (declare (pure ...)), Al, 2024/02/10
- Re: (declare (pure ...)), Pietro Cerutti, 2024/02/10
- Re: (declare (pure ...)), Pietro Cerutti, 2024/02/10
- Re: (declare (pure ...)),
Peter Bex <=
- Re: (declare (pure ...)), Pietro Cerutti, 2024/02/10
- Re: (declare (pure ...)), siiky, 2024/02/10
- Re: (declare (pure ...)), Peter Bex, 2024/02/10
- Re: (declare (pure ...)), Al, 2024/02/10
Re: (declare (pure ...)), Pietro Cerutti, 2024/02/10