Skip to content

[docs] Add more terms to the Lexicon #8016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/Lexicon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
`mandatory passes <mandatory passes / mandatory optimizations>` have run.
This can be used as input to IRGen to generate LLVM IR or object files.

canonical type
A unique representation of a type, with any `sugar <sugared type>` removed.
These can usually be directly compared to test whether two types are the
same; the exception is when generics get involved. In this case you'll need
a `generic environment`. Contrast with `sugared type`.

Clang importer
The part of the compiler that reads C and Objective-C declarations and
exposes them as Swift. Essentially contains a small instance of Clang
Expand Down Expand Up @@ -110,6 +116,20 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
Describes a type or function where making changes will break binary
compatibility. See :doc:`LibraryEvolution.rst <LibraryEvolution>`.

generic environment
Provides context for interpreting a type that may have generic parameters
in it. Generic parameter types are normally just represented as "first
generic parameter in the outermost context" (or similar), so it's up to the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You use the phrase "outermost context" without defining it. You should be more explicit.

generic environment to note that that type must be a Collection. (Another
way of looking at it is that the generic environment connects
`interface types <interface type>` with
`contextual types <contextual type>`).

generic signature
A representation of all generic parameters and their requirements. Like
types, generic signatures can be `canonicalized <canonical type>` to be
compared directly.

iff
"`if and only if`__". This term comes from mathematics.

Expand Down Expand Up @@ -324,6 +344,13 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
known as "swiftCore"); sometimes it means everything in the stdlib/
directory. Pronounced "stid-lib" or "ess-tee-dee-lib".

sugared type
A type that may have been written in a more convenient way, using special
language syntax or a typealias. (For example, ``Int?`` is the sugared form
of ``Optional<Int>``.) Sugared types preserve information about the form
and use of the type even though the behavior usually does not change
(except for things like access control). Contrast with `canonical type`.

thunk
In the Swift compiler, a synthesized function whose only purpose is to
perform some kind of adjustment in order to call another function. For
Expand Down