Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does this notation involving angle brackets mean? [duplicate]

I'm reading Async in C# 5.0, and the section on the compiler transform contains this snippet:

public Task<int> AlexsMethod()
{
    <AlexsMethod>d__0 stateMachine = new <AlexsMethod>d__0();
    stateMachine.<>4__this = this;
    stateMachine.<>t__builder = AsyncTaskMethodBuilder<int>.Create();
    stateMachine.<>1__state = -1;
    stateMachine.<>t__builder.Start<<AlexsMethod>d__0>(ref stateMachine);
    return stateMachine.<>t__builder.Task;
}

There are two pieces of notation that are new to me. The first is <AlexsMethod>d__0. The second is stateMachine.<>4__this. Neither works when I try them myself, so I suspect it's for use by the compiler only. But I'm having trouble searching for more information on what is intended by this notation.

like image 652
Matthew Avatar asked Jun 15 '13 18:06

Matthew


People also ask

What is angle bracket notation?

An angle bracket is the combination of a bra and ket (bra+ket = bracket) which represents the inner product of two functions or vectors (or 1-forms), in a function space, or. in a vector space.

What does double angle brackets mean?

Usage of angle bracketsIn some languages, a double set of angle brackets may be used in place of quotation marks to contain quotes. In English, they may be used informally to insert asides, indicate speech in a foreign language, or to mention a website, but all of these uses are rare even in informal writing.

What do slanted brackets mean?

The angled brackets represent an inner product. The best known one is the scalar product or the dot product. If u=(u1,u2,u3) and v=(v1,v2,v3), then the dot product is given by ⟨u,v⟩=u1v1+u2v2+u3v3.

How do you type double angle brackets?

You can enter double angle brackets, or chevrons («»), directly into a script by typing Option-Backslash and Shift-Option-Backslash.


1 Answers

Unlike the brackets marking generics (e.g. Task<int>), they don't have special meaning. They're just what the compiler generates - identifiers that are valid in IL, but not in C#.

like image 135
Tim S. Avatar answered Nov 09 '22 23:11

Tim S.