C# Async Functions

I was reviewing the new C# specification and the changes that Async Functions made to my beloved language and saw the below section. The outcome has two impression, First it’s funny! Seeing 5 identical phrase in a series in a programming language expression is strange and funny, admit it. But other than that it is definitely complex. It shows all the grammatical and lexical efforts behind the scene for developing such robust and non-nonsense language. Thank you guys, I love the way C# is growing. Thanks.


The grammar of C# is extended as follows:



asyncopt anonymous-function-signature => anonymous-function-body

asyncopt delegate explicit-anonymous-function-signatureopt block

The async modifier is not allowed on method-declarations where the method-body is a ‘;’.

Note that async is a contextual keyword. In all syntactic contexts other than the ones above it is considered an identifier. Thus, the following is allowed (though strongly discouraged!):

using async = System.Threading.Tasks.Task;

async async async(async async) { }

%d bloggers like this: