[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (declare (pure ...))
From: |
Al |
Subject: |
Re: (declare (pure ...)) |
Date: |
Sat, 10 Feb 2024 10:25:57 +0200 |
User-agent: |
Betterbird (Linux) |
On 2024-02-10 10:13, Pietro Cerutti wrote:
I don't get your question: those two things are the same thing :)
Referential transparency means you can substitute an expression with
its expansion down to a value. If anything happening in between causes
(observable *) changes, you can't do it anymore.
(*) modifying the program counter is not an observable change, for
example.
Those two things are the same thing in Haskell and languages that have a
mathematical model of the program, yes. Scheme is... not that, much of
the time. Chicken is implemented on top of C, so it's even less clear.
But let's not get theoretical, yes, my question is if csc can (does?)
"memoize" the results of "pure" function.
In any case, the definitions I quoted above
* https://wiki.call-cc.org/man/5/Declarations#pure
* https://wiki.call-cc.org/man/5/Types#purity
are not the same thing, so either the one or the other should stand.
Though I'm not sure what "local variables or data contained in local
variables" actually means. I think it means you can't "set!" globals.
-- Al
- (declare (pure ...)), Al, 2024/02/09
- Re: (declare (pure ...)), siiky, 2024/02/09
- 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 <=
- 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, 2024/02/10
- Re: (declare (pure ...)), Pietro Cerutti, 2024/02/10
- Re: (declare (pure ...)), siiky, 2024/02/10
- Re: (declare (pure ...)), Peter Bex, 2024/02/10