Anders Hejlsberg's C# 4.0 REPL

前端 未结 10 731
甜味超标
甜味超标 2020-12-13 04:05

During the last 10 minutes of Ander\'s talk The Future of C# he demonstrates a really cool C# Read-Eval-Print loop which would be a tremendous help in learning the language.

10条回答
  •  长情又很酷
    2020-12-13 04:32

    From time to time I want to try out some .NET API instead of wondering about C# language syntax. (There are far more subtleties in API than in the language itself.) If you are only looking for REPL for .NET, good old PowerShell is always with you.

    C#:

    using System;
    using System.Text;
    
    Convert.ToBase64String(Encoding.UTF8.GetBytes("Overflow"));
    

    PowerShell:

    [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("Overflow"))
    

提交回复
热议问题