Typedef names vs. new types.

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Oct 26 19:35:48 AEST 1988


In article <10006 at haddock.ima.isc.com> karl at haddock.ima.isc.com (Karl Heuer) writes:
>Let's enhance the syntax of declarations to include a dimension-specifier...

Unfortunately this is too simplistic.  For example, there are several
ways to combine the Cartesian-projected elements of a tensor to produce
a quantity having different dimension, but the resulting dimension is
not ascertainable from a syntactic analysis of the combination.  Also,
units that people usually consider different turn out to be the same
when one has a sufficiently powerful physical theory.

Thus it is better to provide definitional facilities along the lines
of classes, whereby one can specify the allowed operations and the
properties of the results.  In general structured types are necessary
to encode all the possibly relevant dimensional attributes of a quantity.



More information about the Comp.std.c mailing list