diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-02-13 22:54:22 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-02-14 21:25:33 +0100 |
| commit | fe055aa1ae36ee8058a2da7eabc63da913123a69 (patch) | |
| tree | 594881fd4416e097ad6bdcc0dd8108a9cf574f7c /doc/type-system.tex | |
| parent | d7c27f1c6328198d0513d94bfd6462ad8ac7d2d5 (diff) | |
| download | elna-fe055aa1ae36ee8058a2da7eabc63da913123a69.tar.gz | |
Document expressions
Diffstat (limited to 'doc/type-system.tex')
| -rw-r--r-- | doc/type-system.tex | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/doc/type-system.tex b/doc/type-system.tex index 4ac36e4..3ae8a30 100644 --- a/doc/type-system.tex +++ b/doc/type-system.tex @@ -124,35 +124,3 @@ begin e := E.one end. \end{lstlisting} - -\chapter{Type operations} - -\chapter{Cast} - -\begin{grammar} -<cast> = `cast' `(' <expression> `:\@' <type> `)'. -\end{grammar} - -The type of an object can be reinterpreted with a cast expression: \\ -\verb|cast(object: Type)|. - -\chapter{Traits} - -\begin{grammar} -<trait-identifier> = `#' <identifier>. - -<trait> = <trait-identifier> `(' [<types>] `)'. -\end{grammar} - -Traits allow to query some information about the types, like their size or -field offset or alignment. Calling a trait looks like a procedure call but -traits names start with a \verb|#| and their arguments are type expressions and -not value expressions. - -Supported compiler traits: - -\begin{itemize} - \item \verb|#size(T)| queries type size. - \item \verb|#align(T)| queries type alignment. - \item \verb|#offset(T, F)| queries the offset of the field \verb|F| in the record \verb|T|. -\end{itemize} |
