Skip to content

Named arguments support #109

Open
Open
@ko-vasilev

Description

@ko-vasilev

Hello,
Couldn't find anything about this - but is there a support for named optional arguments in function calls?
Here is something I'm trying to do:

public class Program
{
	public class Ctx
	{
		public double Subtract(double x = 0, double y = 1)
		{
			return x - y;
		}
	}
	
	public static void Main()
	{
		ExpressionEvaluator evaluator = new ExpressionEvaluator();
		evaluator.Context = new Ctx();
		
		string expression = "Subtract(y:2)";
		
		Console.WriteLine(expression);
		Console.WriteLine(evaluator.Evaluate(expression));
		Console.WriteLine(string.Empty);
	}
}

So I'd expect to be able to use named argument just like in C#, is there a support for that? If no, do you have any plans for implementing it?

Thank you.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions