1978 | OriginalPaper | Buchkapitel
Simple Data Structuring
verfasst von : Derek Coleman
Erschienen in: A Structured Programming Approach to Data
Verlag: Macmillan Education UK
Enthalten in: Professional Book Archive
Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.
Wählen Sie Textabschnitte aus um mit Künstlicher Intelligenz passenden Patente zu finden. powered by
Markieren Sie Textabschnitte, um KI-gestützt weitere passende Inhalte zu finden. powered by
A simple structured type can be formed by the set product† of two or more unstructured types. The result is known as a record type. A familiar example is the type complex number, which consists of all possible ordered pairs of real numbers. Thus <math display="block"><mtable columnalign="right"><mtr><mtd><mi>t</mi><mi>y</mi><mi>p</mi><mi>e</mi><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>l</mi><mi>e</mi><mi>x</mi><mo>=</mo><mi>r</mi><mi>e</mi><mi>c</mi><mi>o</mi><mi>r</mi><mi>d</mi></mtd></mtr><mtr><mtd><mi>r</mi><mi>e</mi><mi>a</mi><mi>l</mi><mi>p</mi><mi>a</mi><mi>r</mi><mi>t</mi><mo>:</mo><mi>r</mi><mi>e</mi><mi>a</mi><mi>l</mi></mtd></mtr><mtr><mtd><mi>i</mi><mi>m</mi><mi>a</mi><mi>g</mi><mi>p</mi><mi>a</mi><mi>r</mi><mi>t</mi><mo>:</mo><mi>r</mi><mi>e</mi><mi>a</mi><mi>l</mi></mtd></mtr><mtr><mtd><mi>e</mi><mi>n</mi><mi>d</mi></mtd></mtr></mtable></math> $$ \begin{gathered} \hfill type\,complex=record \\ \hfill realpart: real \\ \hfill imagpart : real \\ \hfill end \\ \end{gathered} $$ or more briefly <math display="block"><mtable columnalign="right"><mtr><mtd><mi>t</mi><mi>y</mi><mi>p</mi><mi>e</mi><mi>c</mi><mi>o</mi><mi>m</mi><mi>p</mi><mi>l</mi><mi>e</mi><mi>x</mi><mo>=</mo><mi>r</mi><mi>e</mi><mi>c</mi><mi>o</mi><mi>r</mi><mi>d</mi></mtd></mtr><mtr><mtd><mi>r</mi><mi>e</mi><mi>a</mi><mi>l</mi><mi>p</mi><mi>a</mi><mi>r</mi><mi>t</mi><mo>,</mo><mi>i</mi><mi>m</mi><mi>a</mi><mi>g</mi><mi>p</mi><mi>a</mi><mi>r</mi><mi>t</mi><mo>:</mo><mi>r</mi><mi>e</mi><mi>a</mi><mi>l</mi></mtd></mtr><mtr><mtd><mi>e</mi><mi>n</mi><mi>d</mi></mtd></mtr></mtable></math> $$ \begin{gathered} \hfill type\,complex = record \\ \hfill realpart, imagpart:real \\ \hfill end \\ \end{gathered} $$ define complex numbers to be records with realpart and imagpart components, and each components is of type real.