What I'm looking for seems to be overlapping the scripting and compiling features of Roslyn compiler as such I am confused as to which one I should be using.
I'd like to declare/define variables (and evaluate their values) as I go along and at some point list then perhaps by name/type. Do I need CodeAnalysis package or Compiler for that? and how?
Example:
// I'd like to add the following to my scripting or compilation engine:
int a = 1 + 2;
string b = "some " + a;
// and then get a listing of their names, types, and values:
foreach(var myvar in script.ListVariables())
Console.WriteLine(myvar.Name + " " + myvar.Type + " " + myvar.Value.ToString());