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

Making local definitions more like top-level definitions.




>From willc:
>5.  Apparently this proposal would require readers to construct and to sort
>static dependency graphs topologically in order to understand LETREC and
>internal definitions, when the writer of the code can easily make the
>dependencies explicit by nesting the LETREC or internal definitions within
>a LET*.  If the proposal ever affects the meaning of a program, therefore,
>then either the writer of the program was deliberately being obscure or
>else the writer has made a mistake.

Two points: Eric Tiedemann talked about changing LETREC.  I don't want
to change LETREC, but once you have local definitions that act more like
top-level definitions, LETREC is redundent, and can be expunged.

The "proposal" would require readers to construct and sort graphs only
if they choose to read programs imperatively.  Hopefully, real
programmers would think of local definitions as equational assertions
with local scope.  The meaning of the equations is derived from their
interdepencies, not the order of presentation.  At top-level, there is
a curious interpretation of definitions which depends partly on the
order of presentation.  With the semantics I have provided, top-level
definitions could be surrounded by a LAMBDA-expression so as to become
local definitions, and their meaning would not surprise a user.  This
would make local definitions more like top-level definitions.

John