29 Mayıs 2020 Cuma

Verbatim Identifier

Giriş
Eskiden keyword olmayan ancak daha sonra keywork olan identifier'lar olabilir. Örneğin ismi yiedl olan bir identifer olabilir. Açıklaması şöyle. Bu durumda identifier başına @ karakteri getirilir.
The answer is straightforward. Imagine that we are back in the day when C# 2.0 just shipped. You have a C# 1.0 program that uses yield as an identifier, which is entirely reasonable; “yield” is a common term in many business and scientific applications. Now, C# 2.0 was carefully designed so that C# 1.0 programs that use yield as an identifier are still legal C# 2.0 programs; it only has its special meaning when it appears before return, and that never happened in a C# 1.0 program. But still, you decide that you’re going to mark the usages of yield in your program as verbatim identifiers so that it is more clear to the future readers of the code that it is being used as an identifier, not as part of an iterator.
Örnek
Şöyle yaparız
@object

Hiç yorum yok:

Yorum Gönder