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

[ramsdell: truth of (), etc...]

Will Clinger wrote:

   For what it's worth, here are the two reasons that I prefer the existing

     1.  I find that it is easier to understand code when I can assume that
	 the order of definitions doesn't matter.  That way I can read the
	 definitions in any order.  This is a special case of the general
	 principle that a more declarative semantics makes programs easier
	 to understand.

The point is that under the current semantics, the order in which you
write top level definitions does matter.  No matter what is in R^nRS,
I suspect most Scheme users will attempt to understand internal
definitions just as they do top level ones: if a lambda expression is
being named, order does not matter, otherwise the order in which
expressions are named does matter.  Note a Scheme user can explicitly
declare that the order of definition does not matter by using the
LETREC syntax.  Given the existence of LETREC, I find it hard to
justify having the meaning of the DEFINE syntax depend on the
environment in which it is used.  The principle that a more
declarative semantics makes programs easier to understand is a sound
one.  In this case, giving DEFINE a uniform semantics conflicts with
this principle.  I vote for uniformity.

     2.  (This reason is pretty weak.)  For the compiler writer, I think the
	 freedom to rearrange definitions makes closure analysis a little
	 simpler when procedure definitions are mixed with definitions of
	 variables containing non-procedure values.

I agree that this reason is pretty weak.

   Note that I am very strongly proposed to another proposal that was
   advanced some time ago, which would require a rather complicated and
   unintuitive order of evaluation that could only be specified in terms
   of a static dependency analysis.

The proposal to which Will refers is a proposal I made to do a
dependency analysis on definitions.  As a result of various
conversations, I no longer support this and proposes sending it to
Lotus so they can patent the idea and spend more money on lawyers.