Ignore:
Timestamp:
Apr 3, 2024, 12:24:23 PM (9 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
4a72fef, d3a49864
Parents:
b5bfb16
Message:

clear out draft content and link syntactic reference figures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/background.tex

    rb5bfb16 r2d82999  
    5252In these declarations, the resulting types are both arrays, but their lengths are inferred.
    5353
    54 \begin{tabular}{lllllll}
    55 @float x;@ & $\rightarrow$ & (base element) & @float@ & @float x;@ & @[ float ]@ & @[ float ]@ \\
    56 @float * x;@ & $\rightarrow$ & pointer & @float *@ & @float * x;@ & @[ * float ]@ & @[ * float ]@ \\
    57 @float x[10];@ & $\rightarrow$ & array & @float[10]@ & @float x[10];@ & @[ [10] float ]@ & @[ array(float, 10) ]@ \\
    58 @float *x[10];@ & $\rightarrow$ & array of pointers & @(float*)[10]@ & @float *x[10];@ & @[ [10] * float ]@ & @[ array(*float, 10) ]@ \\
    59 @float (*x)[10];@ & $\rightarrow$ & pointer to array & @float(*)[10]@ & @float (*x)[10];@ & @[ * [10] float ]@ & @[ * array(float, 10) ]@ \\
    60 @float *(*x5)[10];@ & $\rightarrow$ & pointer to array & @(float*)(*)[10]@ & @float *(*x)[10];@ & @[ * [10] * float ]@ & @[ * array(*float, 10) ]@
    61 \end{tabular}
    62 \begin{cfa}
    63          x5 =    (float*(*)[10]) x4;
    64 //      x5 =     (float(*)[10]) x4;  // wrong target type; meta test suggesting above cast uses correct type
    65 
    66         // [here]
    67         // const
    68 
    69         // [later]
    70         // static
    71         // star as dimension
    72         // under pointer decay:                         int p1[const 3]  being  int const *p1
    73 
    74         const float * y1;
    75         float const * y2;
    76         float * const y3;
    77 
    78         y1 = 0;
    79         y2 = 0;
    80         // y3 = 0; // bad
    81 
    82         // *y1 = 3.14; // bad
    83         // *y2 = 3.14; // bad
    84         *y3 = 3.14;
    85 
    86         const float z1 = 1.414;
    87         float const z2 = 1.414;
    88 
    89         // z1 = 3.14; // bad
    90         // z2 = 3.14; // bad
    91 
    92 
    93 }
    94 
    95 #define T float
    96 void stx2() { const T x[10];
    97 //                      x[5] = 3.14; // bad
    98                         }
    99 void stx3() { T const x[10];
    100 //                      x[5] = 3.14; // bad
    101                         }
    102 \end{cfa}
    103 
    10454My contribution is enabled by recognizing
    10555\begin{itemize}
     
    13282The \CFA-Full column gives the spelling of a different type, introduced in TODO, which has all of my contributed improvements for safety and ergonomics.
    13383
    134 \noindent
    135 \textbf{Unfortunate Syntactic Reference}
     84\VRef[Figure]{bkgd:ar:usr:avp} gives this reference for the discussion so far.
    13685
    13786\begin{figure}
     
    225174            \\ \hline
    226175\end{tabular}
    227 \caption{Figure}
     176\caption{Unfortunate Syntactic Reference for Array vs Pointer.  Includes interaction with constness.}
     177\label{bkgd:ar:usr:avp}
    228178\end{figure}
     179
     180
     181
     182
     183
     184TODO: Address these parked unfortunate syntaxes
     185\begin{itemize}
     186        \item static
     187        \item star as dimension
     188        \item under pointer decay:                              int p1[const 3]  being  int const *p1
     189\end{itemize}
    229190
    230191
     
    323284\lstinput{32-42}{bkgd-carray-decay.c}
    324285
    325 \noindent
    326 \textbf{Unfortunate Syntactic Reference}
    327 
    328 \noindent
    329 (Parameter declaration; ``no writing'' refers to the callee's ability)
     286\VRef[Figure]{bkgd:ar:usr:decay-parm} gives the reference for the decay phenomenon seen in parameter decalarations.
    330287
    331288\begin{figure}
     
    364321            \\ \hline
    365322\end{tabular}
    366 \caption{Figure}
     323\caption{Unfortunate Syntactic Reference for Decay during Parameter-Passing.  Includes interaction with constness, where ``no writing'' refers to a restriction on the callee's ability.}
     324\label{bkgd:ar:usr:decay-parm}
    367325\end{figure}
    368326
Note: See TracChangeset for help on using the changeset viewer.