views:

137

answers:

2

In one of my C# application I use IronPython as a script language. It looks something like this:

string scriptCode = "20 * 5";
ScriptEngine engine = Python.CreateEngine();
ScriptSource source =
  engine.CreateScriptSourceFromString(scriptCode , SourceCodeKind.Expression);
Console.WriteLine(source.Execute<int>());

Will I be able to do something similar with C# 4.0? Can I use C# as my scripting language instead of IronPython?

+2  A: 

No - not out of the box, anyway. C# itself isn't becoming a scripting language, at the moment anyway. The C# team are considering that scenario in general though.

(That post talks about C# already being a scripting language - in certain scenarios.)

The preceding post is equally relevant, btw.

Jon Skeet
A: 

Is perhaps CS-Script what you're looking for?

Regards,

Sebastiaan

Sebastiaan Megens