Creating anonymous type from a dictionary

I want to use math.evaluation library which uses this syntax:

var fn = "x1 + x2 * 7"
    .Compile(new { x1 = 0.0, x2 = 0.0 }, new MathContext());

var value = fn(new { x1 = 23, x2 = 39 });

Notice new { x1 = 0.0, x2 = 0.0 } which is an anonymous type in C#. But I don’t know an equivalent for this in VVVV.

Is there a way to convert a dictionary containing { x1 = -0.5, x2 = 0.5 } to an anonymous type like this in gamma? I cannot use a dictionary directly because I see this error:

System.NotSupportedException: ‘System.Collections.Generic.IEqualityComparer`1[System.String] isn’t supported.’

I just realized that an anonymous type is not a dynamic thing but something that a compiler compiles. So converting from a dictionary to an anonymous type may be not possible.

However what I want to achieve may still be achievable using named tuples or ValueTuple. couldn’t find an example of ValueTuple in HelpBrowser though. Does anyone know how to use it?

Update: Closing this as the library author agreed to add support for dictionary

This so called dynamic in C# I’m pretty sure I was using it already in VL

Oh I didn’t mean it as a keyword. I actually meant that dictionary is a run-time thing while anonymous type is compile-time.

The dynamic is more kind of a dictionary, where you add keys (properties) dynamically, and then you can traverse by keys, like if includes key.

The example code you provided looks kind of similar to how dynamic object works… you define some string extension, e.g. .Compile and for compile to work you define dynamic as argument, and then you parse string on keys, and check if dynamic includes key… tryParse and you are done…