Well, that was satisfying ... "Hello World!" with .Net 6

… slashing all the boiler template code :nerd_face:

//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;

//namespace Cons_CS_NetCore
//{
    //static class Program
    //{
        //public static Int32 Main(string[] args)
        //{
            //Console.WriteLine("The magic happens here.");
            //return 0;
        //}
    //}
//}

Console.WriteLine("Hello World!");
1 Like

Should work for all platforms, FWIW (older/Classic .NET, as well as non-.NET), as well. :upside_down_face:

2 Likes

Is it difficult to add that to the other languages?

Should be easy. Swift always supported this, and Oxygene has begin/end. so doesn’t really need this. But adding it to Mercury should be simple; i’ll log.

1 Like

Logged as bugs://E25540.

Could begin end be extended to support a task ?

begin
  await Task.Delay(TimeSpan.FromSeconds(2));
end.

With this I get await is not supported here.

Logged as bugs://E25541.

bugs://E25541 was closed as fixed.

It builds but doesn’t seem to wait

ClassLessApplication.zip (130.7 KB)

I just see ‘start’ on the console.

These are the same arent they ?

namespace ClassLessApplication;

interface

uses
  System.Diagnostics;

implementation

begin
  Console.WriteLine('Start');
  var sw := Stopwatch.StartNew;
  await Task.Delay(TimeSpan.FromSeconds(2));
  sw.Stop;
  Console.WriteLine(sw.ElapsedMilliseconds);
  Console.WriteLine('Stop');
end.```

c#

using System.Diagnostics;

var sw = Stopwatch.StartNew();

await Task.Delay(TimeSpan.FromSeconds(2));

sw.Stop();

Console.WriteLine(sw.ElapsedMilliseconds);

bugs://E25540 was closed as fixed.

bugs://E25541 was reopened.

bugs://E25541 was closed as fixed.

My apologies I overlooked 1 change that caused this. Properly fixed now.

4 Likes

You’re right, the shortest Oxygene program I’ve written yet! Works in both .Net 6.0 and Classic .Net :nerd_face:

namespace NetCoreTestOxy;

begin
  writeLn('The magic happens here.');
end.
1 Like