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

Re: [Scheme-reports] Procedural equivalence: the last debate



Peter Bex scripsit:

> I've never understood this jump in logic: If the compiler only rewrites
> car in operand position, how would you ever be able to obtain a reference
> to it?  All other cars are not rewritten, so (eq? car car) will always
> refer to the non-rewritten version of car.

The idea is to be able to rewrite *all* cars.  That way, you can propagate
the lambda so that you can eta-expand it at the eventual point of call,
at least in principle.  Again, the assumption is that the only thing
you can do with a procedure is call it.

It also occurs to me that with the introduction of records into the
language, it's possible for the user to get back procedures-with-identity
by wrapping the procedure in a trivial record, since records do have
identity in R6RS.  This enables all of Alex's use cases to come back,
at the expense of not being able to pass a procedure directly to a
HOF that wants to detect particular procedures and optimize them (the
fifth bullet).  There is no loss of power, but there is a considerable
loss of naturalness.

-- 
A mosquito cried out in his pain,               John Cowan
"A chemist has poisoned my brain!"              http://www.ccil.org/~cowan
        The cause of his sorrow                 cowan@x
        Was para-dichloro-
Diphenyltrichloroethane.                                (aka DDT)

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