Skip to content

Commit 56ac97c

Browse files
committed
[doc] Tweak recent Lexicon additions based on feedback.
1 parent f21cf74 commit 56ac97c

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

docs/Lexicon.rst

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
2020

2121
archetype
2222
A placeholder for a generic parameter or an associated type within a
23-
generic context.
23+
generic context. Sometimes known as a "rigid type variable" in formal
24+
CS literature. Directly stores its conforming protocols and nested
25+
archetypes, if any.
2426

2527
canonical SIL
2628
SIL after the
@@ -38,9 +40,12 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
3840
the AST level. See also `witness table`.
3941

4042
contextual type
41-
The type of a value or declaration from inside a generic context. This type
42-
may contain `archetypes <archetype>` and cannot be used directly from
43-
outside the context. Compare with `interface type`.
43+
1. The expected type for a Swift sub-expression based on the rest of the
44+
statement. For example, in the statement ``print(6 * 9)``, the contextual
45+
type of the expression ``6 * 9`` is ``Any``.
46+
2. The type of a value or declaration from inside a potentially generic
47+
context. This type may contain `archetypes <archetype>` and cannot be
48+
used directly from outside the context. Compare with `interface type`.
4449

4550
DI (definite initialization / definitive initialization)
4651
The feature that no uninitialized variables, constants, or properties will
@@ -58,12 +63,18 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
5863
compatibility. See :doc:`LibraryEvolution.rst <LibraryEvolution>`.
5964

6065
iff
61-
"if and only if". This term comes from mathematics.
66+
"`if and only if`__". This term comes from mathematics.
67+
68+
__ https://en.wikipedia.org/wiki/If_and_only_if
6269

6370
interface type
6471
The type of a value or declaration outside its generic context. These types
65-
can be compared across declarations but cannot be used directly from within
66-
the context. Compare with `contextual type`.
72+
are written using "formal" generic types, which only have meaning when
73+
combined with a particular generic declaration's "generic signature".
74+
Unlike `contextual types <contextual type>`, interface types store
75+
conformances and requirements in the generic signature and not in the types
76+
themselves. They can be compared across declarations but cannot be used
77+
directly from within the context.
6778

6879
IUO (implicitly unwrapped optional)
6980
A type like Optional, but it implicitly converts to its wrapped type. If

0 commit comments

Comments
 (0)