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

re: structures

Morris Katz <MKATZ@A.ISI.EDU> wrote:

    [He discussed a structures package written by Steware Clamen that is
     similar to Norman Adams' proposal.  He mentioned some of its
     additional properties.]
    The first is an option as to whether a structure should carry along
    its type and be runtime type checked each time an accessor or mutator
    utilizes it.  This allows the user a trade-off between type security
    and execution efficiency.

If this trade-off is controlled by options in the structure
definition, I sure hope the sense of the option is "right".  The
default should be as type secure as possible.

The context where accessors and mutators are used should determine
whether or not run-time type-checking is performed.  If implicit and
explicit type-checking is never used at run-time, the type information
may be optimized away.  (That may not be possible for top-level
definitions in an interactive system, but ....)  T (and MacLisp) had a
primitive version of this for predefined structures (cons' and vectors
are the ones I remember); if a procedure is compiled with the
appropriate options, the compiled code does not include type-checks.

#include	{standard args for incomplete type-inference systems}

I realize that Adams' proposal does not have the hooks for a useful
type-inference system, but that is a good direction to leave open.