perhaps I've missed something ... John Clements (20 Jan 2000 22:21 UTC)
Re: perhaps I've missed something ... Lars Thomas Hansen (20 Jan 2000 22:38 UTC)
Re: perhaps I've missed something ... Shriram Krishnamurthi (20 Jan 2000 22:52 UTC)
Re: perhaps I've missed something ... Lars Thomas Hansen (20 Jan 2000 23:02 UTC)
Re: perhaps I've missed something ... John Clements (20 Jan 2000 22:58 UTC)
Re: perhaps I've missed something ... Lars Thomas Hansen (20 Jan 2000 23:05 UTC)
Re: perhaps I've missed something ... John Clements (20 Jan 2000 23:12 UTC)
Re: perhaps I've missed something ... sperber@xxxxxx (21 Jan 2000 07:38 UTC)
Re: perhaps I've missed something ... Lars Thomas Hansen (20 Jan 2000 22:44 UTC)
Re: perhaps I've missed something ... John Clements (20 Jan 2000 23:09 UTC)
Re: perhaps I've missed something ... Per Bothner (20 Jan 2000 23:01 UTC)
Re: perhaps I've missed something ... Matthias Felleisen (20 Jan 2000 23:18 UTC)
Re: perhaps I've missed something ... Per Bothner (20 Jan 2000 23:55 UTC)
Re: perhaps I've missed something ... Matthias Felleisen (21 Jan 2000 01:04 UTC)
Re: perhaps I've missed something ... Per Bothner (21 Jan 2000 01:49 UTC)
Re: perhaps I've missed something ... Matthias Felleisen (21 Jan 2000 02:40 UTC)
Re: perhaps I've missed something ... thi (21 Jan 2000 09:58 UTC)
Re: perhaps I've missed something ... Per Bothner (21 Jan 2000 18:36 UTC)
Re: perhaps I've missed something ... sperber@xxxxxx (22 Jan 2000 10:32 UTC)
Re: perhaps I've missed something ... Per Bothner (23 Jan 2000 20:02 UTC)
Re: perhaps I've missed something ... Shriram Krishnamurthi (23 Jan 2000 20:50 UTC)
Re: perhaps I've missed something ... Per Bothner (23 Jan 2000 21:25 UTC)
Re: perhaps I've missed something ... sperber@xxxxxx (24 Jan 2000 07:30 UTC)
Re: perhaps I've missed something ... Michael Livshin (24 Jan 2000 16:55 UTC)
Re: perhaps I've missed something ... sperber@xxxxxx (25 Jan 2000 07:43 UTC)
Re: perhaps I've missed something ... Michael Livshin (25 Jan 2000 11:02 UTC)
Re: perhaps I've missed something ... sperber@xxxxxx (25 Jan 2000 11:31 UTC)
Re: perhaps I've missed something ... Matthias Felleisen (25 Jan 2000 13:47 UTC)
Re: perhaps I've missed something ... sperber@xxxxxx (24 Jan 2000 07:29 UTC)
Re: perhaps I've missed something ... John Clements (20 Jan 2000 23:59 UTC)
Re: perhaps I've missed something ... Per Bothner (21 Jan 2000 00:18 UTC)
Re: perhaps I've missed something ... Shriram Krishnamurthi (21 Jan 2000 00:03 UTC)
Re: perhaps I've missed something ... Per Bothner (21 Jan 2000 00:37 UTC)
Re: perhaps I've missed something ... Shriram Krishnamurthi (21 Jan 2000 08:39 UTC)

Re: perhaps I've missed something ... Per Bothner 20 Jan 2000 23:01 UTC

John Clements <xxxxxx@cs.rice.edu> writes:

> ... but I fail to see the appeal of this mechanism. As far as I can
> tell, a scheme implementation which conforms to this SRFI allows me
> to write
> (set! (car x) 5)
> rather than
> (set-car! x 5)

The issue is that set-car! requires introducing a new primitive
concept, with a new name, that you have to learn and remember.  Yes,
it's easy enough to deal with, thanks to naming conveptions.  But
I would much rather have 50 names for getter+setter procedures
vs 100 names for separate getter and setter procedures.  For one
thing, the latter clutters up manuals and reference cards more!

> To my eyes, the only effect of this change is to confuse the
> primitive which mutates bindings (set!) with a primitive that mutates
> values (set-car!).  Although these two are radically different
> beasts, beginning students often find it hard to understand the
> difference, and a change of this sort will only make it harder to
> teach them.

First, most "beginning students" actually have experience with
languages (such as C or Java) that are more like the proposal.
Secondly, I think you're wrong about the distinction; they are
not radically different beasts.  Semantically:
        (set! x v)
is arguably syntactic sugar for:
        (set! (the-evironment 'x) v)

> ps. Since I am using a fixed-width font, I can see that the second
> one is actually two characters shorter.

But that's hardly the point, is it?  If we were into counting
characters, we'd be using APL (or J or C).  The point is economy
of concepts.

> pps. let and letrec are both binding constructs. I don't see why we
> need two different forms.  Why not just use 'let,' and if any of the
> right-hand-sides happen to refer to the name they're bound to,
> implicitly change the whole thing into a letrec?  I think this would
> be much simpler and avoid lots of confusion.

Sarcasm aside, I agree, sort of.  Having `let', `let*', `letrec'
*plus* internal `define' is overkill.  My advice for anyone designing
a new language would be to drop `let', `let*', and `letrec' and just
keep some variant of internal `define', which of course is basically
syntactic sugar on top of `letrec'.  (For the very rare case that one
might actually need `let' or `let*', use `lambda'.)
--
	--Per Bothner
xxxxxx@bothner.com   http://www.bothner.com/~per/