Re: (declare (pure ...))
Peter Bex <[email protected]>
| Newsgroups | gmane.lisp.scheme.chicken |
|---|---|
| Message-ID | <ZcdsZACni0E1mC_3@doggett> |
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
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE6bh5EUSYP1EE+1UTER25+ctFibAFAmXHbGQACgkQER25+ctF ibBuVQgAmDWM3k6C1o101vRfHO02qBlvU1MrKuHtlqgrcrELl51Mtt+xc5lsWGri DPIAFIPP5QySczAsP5D931KDCgAEZV+NPBsB44I2s5Znz3q5OalyV0STeuD6rMWA 3kQ60e7a1rthSSs8/aRhF3MRPWJpWAsHZsTUlJraNLdQb1yhImVfXE0mL/rsOy2o bCnf+oiEM0i4uxTDv1OMDIoHw6SvAczq1q0D2MbBUvPzuYwr2UUQgZNarfkLdhPZ +oAtsvC4uHMlOOo9m76+3o7XoAy/WwBhKsegiD99OfBNeXl41i95b9d1epLthfue bq2c13dUslcNMcjgPCiSBoyNvwfHyg== =8E1T -----END PGP SIGNATURE-----