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

(let (foo) ...)



I remember having proposed during the preparation of the last Scheme
meeting that (let (foo) ...) creates an uninitialized binding.  The
binding exists so it can be closed over, it can be assigned to but it
cannot be dereferenced, before it is assigned, without signalling an
error.

This offers the following advantages: it allows to turn letrec into a
regular syntax that does not use the extra linguistic object
"undefined". It allows expansions of macros to protect some visible
bindings from being changed (just wrap the expansion in a let
shadowing the visible bindings to protect).  Finally this is a static
property that does not impact those that do not use it. Roughly: only
the body of let has to compile references to initially uninitialized
variable with a check to ensure that they are now defined. Some
rudimentary (initialization) analysis can be done to see if the
variable is assigned before being referenced. This analysis easily
grasps the letrec pattern.

This offers the following deficiency: it turns let into a special form.

		Christian.