L
> On 10 Feb 2024, at 13:30, Peter Bex wrote:
>
> On Sat, Feb 10, 2024 at 12:24:36PM +, 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
On 2024-02-10 14:28, Peter Bex wrote:
CHICKEN's type system differentiates between "pure" and "clean". A "pure"
Hope this clears things up a bit!
Ah, that's what I was looking for. So I shouldn't declare procedures
using vector-ref as pure, but as clean. Now how do I declare a scheme
proced
On Sat, Feb 10, 2024 at 12:24:36PM +, 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
On Sat, Feb 10, 2024 at 11:12:04AM +, siiky via wrote:
> Hi Al,
>
> > On a practical level, I would be sad if vector-ref, for example, was
> > "impure", and thus compiling a vector-ref invalidated all previously-
> > checked globals for the current scope. Likewise, I would prefer to
> > declar
> On 10 Feb 2024, at 11:10, Al wrote:
>
> On 2024-02-10 11:53, Pietro Cerutti wrote:
>
>> I don't see why vector-ref would be any less pure than, say, a let binding.
>> Or do you mean vector-set! ?
>>
> vector-ref, applied to a global, could return different values even when
> called with t
> On 10 Feb 2024, at 11:10, Al wrote:
>
> On 2024-02-10 11:53, Pietro Cerutti wrote:
>
>> I don't see why vector-ref would be any less pure than, say, a let binding.
>> Or do you mean vector-set! ?
>>
> vector-ref, applied to a global, could return different values even when
> called with t
Hi Al,
On a practical level, I would be sad if vector-ref, for example, was
"impure", and thus compiling a vector-ref invalidated all previously-
checked globals for the current scope. Likewise, I would prefer to
declare a procedure using vector-ref as pure, to let csc know that it
does not m
On 2024-02-10 11:53, Pietro Cerutti wrote:
I don't see why vector-ref would be any less pure than, say, a let
binding. Or do you mean vector-set! ?
vector-ref, applied to a global, could return different values even when
called with the same arguments. Between calls, some other code could
mo
> On 10 Feb 2024, at 10:45, Al wrote:
>
> On 2024-02-10 11:20, Pietro Cerutti wrote:
>
>> Both Haskell and CHICKEN ultimately compile to obiect code. That is not
>> important: the important thing is the abstract machine you're programming
>> against. This is why I specified "observable" in m
> On 9 Feb 2024, at 21:06, Al wrote:
> Hi,
>
>
> what does (declare (pure ..)) mean to csc? Is the function supposed to be
>
> * only side-effect free, or ...
>
> * also return the same value when called with the same arguments?
Back to your original question
On 2024-02-10 11:20, Pietro Cerutti wrote:
Both Haskell and CHICKEN ultimately compile to obiect code. That is
not important: the important thing is the abstract machine you're
programming against. This is why I specified "observable" in my
previous reply.
I agree. And if we step out of the
> On 10 Feb 2024, at 09:27, Al wrote:
>
> 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 be
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 anym
> On 10 Feb 2024, at 09:06, Al wrote:
>
>
>>> * only side-effect free, or ...
>>>
>>> * also return the same value when called with the same arguments?
>>
>> The first implies the second: to be able to choose from a set of return
>> values for the same given argument, you do need to have si
* only side-effect free, or ...
* also return the same value when called with the same arguments?
The first implies the second: to be able to choose from a set of
return values for the same given argument, you do need to have
side-effects, e.g., interact with a RNG which maintains state, r
> On 9 Feb 2024, at 21:06, Al wrote:
>
> Hi,
>
>
> what does (declare (pure ..)) mean to csc? Is the function supposed to be
>
> * only side-effect free, or ...
>
> * also return the same value when called with the same arguments?
The first implies the secon
Hi Al,
what does (declare (pure ..)) mean to csc? Is the function supposed to be
* only side-effect free, or ...
* also return the same value when called with the same arguments?
I can't remember where `(declare)` is documented, but I believe this [0]
is also relevant.
[0]
Hi,
what does (declare (pure ..)) mean to csc? Is the function supposed to be
* only side-effect free, or ...
* also return the same value when called with the same arguments?
Thanks,
Al
18 matches
Mail list logo