Re: [Scheme-reports] Procedural equivalence: the last debate taylanbayirli@gmail.com (05 Jun 2013 13:25 UTC)

Re: [Scheme-reports] Procedural equivalence: the last debate taylanbayirli@gmail.com 05 Jun 2013 13:24 UTC

John Cowan <cowan@mercury.ccil.org> writes:

> Shiro Kawai scripsit:
>
>> Oops, I'm probably lost... Does the current discussion suggests that
>> fresh location tag must be allocated for every time lambda expression
>> is evaluated, even the lambda expression doesn't close any mutable
>> state?
>
> That is what R5RS requires, yes, as well as Will's proposal.

R5RS mentions that each procedure created with `lambda' is conceptually
tagged with a storage location "to make eq? and eqv? work," but neither
does it say that each tag must be unique, nor that eq? and eqv? are
required to return #f when the tag differs.  Maybe I'm taking the
wording too literally[1], but it sounds to me like a mere suggestion for
a common implementation strategy, or a clarification on how we can talk
about their equality at all if we are going to ignore any other traits
they possess (namely the environment they closed over, and their code).

Looking at the definitions of eqv? and eq?, it sounds like eq? (which is
said to have the same behavior as eqv? on procedures) is allowed to
return #t for operationally equivalent procedures regardless of any
other trait they possess (perhaps unintentionally hinting at the
possibility of indeed making two operationally equivalent procedures
share the same location tag).

[1] Here is the exact paragraph, for reference:

Each procedure created as the result of evaluating a lambda expression
is (conceptually) tagged with a storage location, in order to make eqv?
and eq? work on procedures (see section 6.1).

Taylan

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports