In this workshop, we'll add a new in
expression to C#, with example use cases shown below:
x in 1..10 // x >= 1 && x < 10
'a' in "bar" // "bar".IndexOf('a') >= 0 -or- "bar".Contains('a')
x in xs // xs.Contains(x)
```csharp | |
/* _ __ ___ _ ____ ____ _ __ __ __ _ _ ___ _ _ __ __ | |
(_)/ _| / / | __ _ _ __ __ _ (_)___ / ___/ ___|| |__ __ _ _ __ _ __ / / \ \ / /__ _ __ ___(_) ___ _ __ _ / |/ _ \ ___ _ __ / / | \ \\ \ | |
| | |_ | || |/ _` | '_ \ / _` | | / __| | | \___ \| '_ \ / _` | '__| '_ \ | | \ \ / / _ \ '__/ __| |/ _ \| '_ \(_) | | | | | / _ \| '__| | | | | || | | |
| | _| | || | (_| | | | | (_| | | \__ \ | |___ ___) | | | | (_| | | | |_) | < < \ V / __/ | \__ \ | (_) | | | |_ | | |_| | | (_) | | | | | > > | | |
|_|_| | ||_|\__,_|_| |_|\__, | |_|___/ \____|____/|_| |_|\__,_|_| | .__/ | | \_/ \___|_| |___/_|\___/|_| |_(_) |_|\___/ \___/|_| |_|_| | || | | |
\_\ |___/ |_| \_\ /_//_/ | |
____ _ |
using System.Collections.Immutable; | |
using System.Numerics; | |
using System.Runtime.CompilerServices; | |
internal class Program | |
{ | |
static void Main(string[] args) => Console.WriteLine("C# Language Internals @ Techorama 2024"); | |
} | |
class CSharp7 |