diff --git a/CPSL.tex b/CPSL.tex index 720df8b..4d677a8 100644 --- a/CPSL.tex +++ b/CPSL.tex @@ -381,10 +381,24 @@ \subsection{For} Either in an monotonically increasing or decreasing fashion depending on whether the keyword to or downto was used. For each value of the new variable a list of statements is executed. \section{Function and Procedure Calls} \subsection{Parameters} -Parameters in CPSL are always passed by value. -No function or procedure can have side effects, except for output or through global variables. +Parameters in CPSL can be passed by either value or reference. To be passed by +reference, a parameter must be a variable. No function or procedure can have +side effects, except for output or through global variables and reference +parameters. \subsection{Return} The return statement passes control back to a function or procedure caller. If it is a function the expression returned becomes the expression of the function call in the callers scope. +\subsection{Function Overloading} +Functions or procedures with different bodies may have the same name. For this +to be valid, each function/procedure must have a different type signature. A type +signature is defined by the order of parameters and their respective types. Note +that, + +\begin{itemize} +\item The parameter names do not affect a function's type signature. +\item \textbf{var}/\textbf{ref} does not change a function's type signature. +\item The return type also does not affect a function's type signature. +\end{itemize} + \section{User Defined Types} \subsection{Arrays} Arrays are a contiguously allocated, homogeneously typed set of variables.