using System;
using System.Collections.Generic;
namespace PreHOPL
{
static class Program
{
private static readonly Dictionary<string, Tuple<int, Delegate>> dict = new Dictionary<string, Tuple<int, Delegate>>()
{
["SAYLIT"] = new Tuple<int, Delegate>(1, (Action<string>)System.Console.WriteLine),
};
private static void Main(string[] args)
{
dict["SAYLIT"].Item2.DynamicInvoke("Hello World!");
}
}
}
I've just tried 4 diferent online tools (Telerik, ICSharpCode, Carlosag and DeveloperFusion) to convert this to VB.Net for a colleague. Three have spat a long error message and the fourth is spinning its wheels going nowhere. Ideas?
Top comments (3)
First of all, I'm afraid this code is as human readable as it is machine readable. I suggest some refactoring. After 30 minutes, I was able to come up with this translation to VB.Net:
Thank you for spending so much time on it. I wonder if
ValueTuple
would simplifying it at all.Building on @raphaelgodart 's approach and utilising
ValueTuple
: