[plt-scheme] Re: Scheme workshop survey

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Sun Oct 19 00:37:49 EDT 2008

> Still, and bear with me here because I'm not trying to be obtuse
> just for the sake of it [...]

That's fine.  Humor doesn't convey well over the Internet, so I wanted
to make sure we understood where you stand to avoid being serious
where you were being ironic.

So, let's take this seriously.

The original question, as I recall it, was phrased as, "The value of
... is [blank box]".  So it depends on what your meaning of "is" is.

You might mean, "what does it print as?".  In that case, there are
many answers; '(a b c) is one of them, (a b c) is another.  But there
might be all sorts of ways of printing that answer (imagine a
box-based graphical syntax, for instance), so choosing this meaning
would result in highly non-canonical answers -- and the set of
representations is boundless.  So it would be an unwise meaning to
have in mind for the question.

You might say it means "what value does it reduce to?".  In that case,
it depends on how you write Scheme values.  It is conventional to
consider values to be a subset of expressions that do not require
further evaluation.  Is the expression

  '(a b c)

a value?  For sure.  How about:

  (list 'a 'b 'c)

?  For sure (just treat LIST as a constructor; if you don't like that,
expand it out into nested CONSes).  But what about:

  (a b c)

?  To me, that expression sure looks like the application of the
(hopefully) procedure bound to A to two values, namely those bound to
B and to C.  That's not a value, that's a procedure application.

Finally, you might say it means "what expression[s] is it equal to?".
This depends on your notion of equality.  A common notion is
observational equivalence.  Again, assuming CAR refers to the
primitive (and hence cannot be re-bound), the original expression is
observationally equivalent to any of the above value representations,
but it is not to

  (a b c)

[because there exist contexts that bind A, B and C unfavorably].

So the question is not "unaswerable"; it's merely ambiguous.  But
under the two standard interpretations one might take -- what does it
reduce to, and what is it equal to -- the answer we're favoring is
right, whereas the unquoted (ie, old-fashioned print) representation
is not.

> I am still not sure that the "value" of "(car ...)" is "(list a b
> c)". Again, it seems that that's an external representation of the
> required value or an expression that evaluates to a value that is
> equal?  to the required value.

Eli already foresaw this.  That's why he wrote what he did.  What is
"the value", really?  In PLT Scheme, it's the thing (pointer) you get
by evaluating his expression.  If you really want to think of that
pointer as the value, fine -- but then,

  (a b c)

is definitely not that pointer!

Shriram


Posted on the users mailing list.