From 30bfb12ced609af7454d7f5050f688b490b8a13e Mon Sep 17 00:00:00 2001 From: Paul Roth Date: Fri, 24 Feb 2017 15:43:28 -0500 Subject: [PATCH] clarify a few sentences in the type system section --- body.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/body.tex b/body.tex index 84c5de3..15b5a55 100644 --- a/body.tex +++ b/body.tex @@ -86,14 +86,14 @@ \subsection{Type System} Manifold allows the assignment of subtype values to a variable whose type is a supertype of the value's, but not vice-versa, i.e., a supertype value cannot be assigned to a subtype variable. -% TODO: make the next few sentences easier to understand Tuple types are the exception to this, being considered compatible if the signature of the tuples -match, and all the subfields are subtypes of the subfields of the other tuple. -Unlike other structural typing systems, Manifold will not slice the fields of a -tuple if you try to assign it to a tuple with a subset of the fields. In a -descriptive language it would be an error to allow the user to hide components -and never connect them. +match, meaning that if the value tuple's subfields are assignable to each of the +variable tuple's subfields, then the value tuple can be assigned to the variable +tuple. As Manifold is a descriptive language, it would be an error to allow +the user to hide components and never connect them, so the language will not slice +the fields of a tuple A if you try to assign A to a tuple B with a subset of A's +fields. \begin{lstlisting}[label=lst:types,caption=Example of types in a Manifold file] // Type definitions