Skip to content

Commit

Permalink
Update chapters/interface.tex
Browse files Browse the repository at this point in the history
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
  • Loading branch information
qlambert-pro and henrikt-ma committed May 31, 2021
1 parent 92e88a6 commit af342e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion chapters/interface.tex
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,13 @@ \section{Function-Compatibility or Function-Subtyping for Functions}\label{funct
constraining interface of the function being redeclared.
\end{itemize}

Note that function-compatibility does currently not ensure that the function call has the correct variability, and that must then be checked after re-declaration -- due to the possibility of default arguments with higher variability.
Note that variability of function calls cannot be determined using the just the interface of a function, as the variabilities of default argument expressions are not expressed by the interface.
Hence a function redeclaration being function-compatible does not ensure that function calls will fulfill variability requirements, and tools must therefore check variability requirements separately.

\begin{nonnormative}
One way that tools may carry out the additional checks is to first infer the variability requirements on functions that can be redeclared, but looking at the expressions where the function is called.
The interface of the function that could be redeclared can then be extended with a variability requirement for any default argument expressions, allowing errors to be detected and reported at the point of a redeclaration that introduces too high variability through default argument expressions.
\end{nonnormative}
\begin{nonnormative}
Thus any call of a function that is replaceable will need to be checked after redeclarations.
\end{nonnormative}
Expand Down

0 comments on commit af342e2

Please sign in to comment.