Skip to content

Commit

Permalink
Clarifying further.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Sep 5, 2022
1 parent 0c14cfe commit be9959f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions chapters/interface.tex
Expand Up @@ -600,13 +600,14 @@ \section{Type Compatible Expressions}\label{type-compatible-expressions}
\begin{itemize}
\item
If \lstinline!A! is a record expression, \lstinline!B! must also be a record expression with the same named elements.
The type of the full expression is a record comprised of named elements that are compatible with the corresponding named elements of both \lstinline!A! and \lstinline!B!.
In an array expression the two records may contain elements with different sizes, but apart from that they must be of compatible types.
In an expression that is not an array expression those elements must be type compatible.
In an array expression the two records may contain elements with different sizes, but apart from that they must be type compatible.
That generates a heterogenous array of records, see \cref{arrays}.
The type of the full expression is a record comprised of named elements that are compatible with the corresponding named elements of both \lstinline!A! and \lstinline!B!.
\item
If \lstinline!A! is an array expression then \lstinline!B! must also be an array expression, and \lstinline!ndims(A)! = \lstinline!ndims(B)!.
The type of the full expression is an array expression with elements compatible with the elements of both \lstinline!A! and \lstinline!B!.
If both \lstinline!size(A)! and \lstinline!size(B)! are known and \lstinline!size(A)! = \lstinline!size(B)! then this defines the size of the type compatible expression, otherwise the size of the expression is not known until the expression is about to be evaluated.
If both \lstinline!size(A)! and \lstinline!size(B)! are known and \lstinline!size(A)! = \lstinline!size(B)! then this defines the size of the full expression, otherwise the size of the full expression is not known until the expression is about to be evaluated.
In case of an \lstinline!if!-expression the size of the full expression is defined based on the branch selected, and for other cases \lstinline!size(A)! = \lstinline!size(B)! must hold at this point.
\item
If \lstinline!A! is a scalar expression of a simple type \lstinline!B! must also be a scalar expression of a simple type.
Expand Down

0 comments on commit be9959f

Please sign in to comment.