guile-devel
[Top][All Lists]
Advanced

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

Re: GNU Guile branch, stable-2.0, updated. v2.0.2-101-gd851e32


From: Ludovic Courtès
Subject: Re: GNU Guile branch, stable-2.0, updated. v2.0.2-101-gd851e32
Date: Tue, 27 Sep 2011 22:37:31 +0200
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

Hi,

Andy Wingo <address@hidden> skribis:

> Regarding identity, `cons' needs to return objects with identity.  These
> expressions expressions are not the same:
>
>   (define f
>     (let ((pair (cons 1 2)))
>       (lambda ()
>         pair)))
>
>   (define f
>     (lambda ()
>       (cons 1 2)))
>
> Here we cannot propagate `pair' because then we would break (eq? (f)
> (f)).  It's a question of identity.

Right, good point.

[...]

> `car' is pure -- if its argument is
> indeed a pair, then it has no side effects -- but it is not constant.

OK, got it!

(Though I think that the term ‘constant’, as used by GCC, is confusing.
I don’t have a better name to propose, though.)

[...]

>>> Also, if I'm correct in guessing the reason for this change (accessing
>>> mutable memory), shouldn't the bytevector-*-ref operations go as well?
>>
>> No because they return an immutable object.
>
> I think we got this wrong, Ludo, and we should probably create some list
> of pure accessors for mutable data and put bytevector-*-ref in it, for
> the same reason given above for `h'.

Yes, agreed.

Thanks!

Ludo’.

PS: In that context, it must be quite a relief to work on a purely
    functional language...  :-)



reply via email to

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