Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Peter Kourzanov (22 Dec 2010 20:47 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? John Cowan (23 Dec 2010 01:49 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Peter Kourzanov (23 Dec 2010 08:25 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? John Cowan (23 Dec 2010 09:13 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? Peter Kourzanov (23 Dec 2010 09:26 UTC)
(missing)
(missing)
(missing)
(missing)
(missing)
(missing)
(missing)
(missing)
(missing)
(missing)
(missing)
(missing)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? Peter Kourzanov (23 Dec 2010 09:28 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? Andre van Tonder (23 Dec 2010 15:11 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? John Cowan (24 Dec 2010 01:14 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? Eli Barzilay (24 Dec 2010 01:40 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Peter Kourzanov (24 Dec 2010 08:55 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? John Cowan (24 Dec 2010 09:20 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Peter Kourzanov (24 Dec 2010 09:26 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? John Cowan (25 Dec 2010 00:32 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? Adrien "Pied" Piérard (24 Dec 2010 11:51 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Peter Kourzanov (24 Dec 2010 12:49 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Eli Barzilay (24 Dec 2010 16:04 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Andre van Tonder (24 Dec 2010 18:33 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? Adrien "Pied" Piérard (27 Dec 2010 01:59 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? John Cowan (27 Dec 2010 05:51 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? Adrien "Pied" Piérard (27 Dec 2010 06:22 UTC)
Re: [Scheme-reports] [r6rs-discuss] case reborn Peter Kourzanov (27 Dec 2010 09:55 UTC)
Re: [Scheme-reports] [r6rs-discuss] do we need to redefine eqv? Peter Kourzanov (29 Dec 2010 12:54 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Peter Kourzanov (24 Dec 2010 12:24 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Eli Barzilay (24 Dec 2010 16:02 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Peter Kourzanov (24 Dec 2010 18:17 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Andre van Tonder (24 Dec 2010 18:44 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Andre van Tonder (24 Dec 2010 18:40 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? Peter Kourzanov (24 Dec 2010 20:07 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? John Cowan (24 Dec 2010 20:40 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Peter Kourzanov (24 Dec 2010 22:11 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? Shiro Kawai (24 Dec 2010 22:27 UTC)
Re: [Scheme-reports] [r6rs-discuss] redefining eqv? Peter Kourzanov (25 Dec 2010 00:48 UTC)
Re: [r6rs-discuss] [Scheme-reports] redefining eqv? John Cowan (25 Dec 2010 00:29 UTC)
(missing)
(missing)
(missing)
(missing)
(missing)
(missing)

Re: [r6rs-discuss] [Scheme-reports] redefining eqv? Peter Kourzanov 23 Dec 2010 09:27 UTC

On Wed, 2010-12-22 at 18:36 -0500, Eli Barzilay wrote:

> You're confusing (or mixing) a local binding (let ((eqv? ...)) ...)
> with an implicit mutation (define eqv? ...).

Is it? The way I read R6RS, (define) is supposed to (#1) allocate a new
location for this new eqv?, (#2) set! the result of the expression to it
and (#3) mutate the *binding* for eqv? in the environment (or splice
into parent environment when enclosed by begin). At least, that's what
it typically does for other variables. I.e.,

(define x 1)
(let () (define x 2) x)
x

is not entirely the same as

(set! x 1)
(let () (set! x 2) x)
x

And, BTW, 11.3 says that (define) is equivalent to (letrec*). So why are
these cases so different then?

To answer Andre as well,
> On Wed, 2010-12-22 at 15:55 -0500, Andre van Tonder wrote:
> It doesn't matter:
>
> From R6RS:

I agree that it shouldn't mutate the original slot of eqv?, as
prescribed by 7.1. But as I read it, R6RS says nothing about the extent
of the new eqv? *binding* (#3 above) (unlike R5RS, for the record). And
thus it can vary wildly depending on how (case) was defined.

I guess if R6RS enforced macro-implementation of (case), like Haskell's
Prelude, the problem would be solved (via syntactic closures provided by
hygiene & referential transparency of syntax-rules).

Alternatively, if you add lazy evaluation of (case) bodies (or simulate
that with delimited continuations, whatever), you can also solve it by
using hygiene & referential transparency of functional closures with
lexical scope. But that is a different language altogether too...

> > And should we do anything about it? [...]
>
> Depends on how "we" is defined.

I am interested in this mostly from the user perspective. I don't
know how many users are hanging around here, but I do hope this
set is at least as large as the set of implementors...

P.S. And I have no problem in (case) using redefined eqv? as you
     might probably have guessed. I think implementations should be
     free to make it (optionally) strict, disallowing rebinding of
     any standard keyword, maybe with define-immutable-binding.
     Otherwise there must be a way to shoot yourself in the foot.

_______________________________________________
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss