Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named arguments support #109

Open
ko-vasilev opened this issue Jul 20, 2021 · 2 comments
Open

Named arguments support #109

ko-vasilev opened this issue Jul 20, 2021 · 2 comments
Assignees

Comments

@ko-vasilev
Copy link

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.

@codingseb
Copy link
Owner

Hello @ko-vasilev. Thanks for this issue.
For now named arguments are not supported.
I think it could be nice to have.
I am on vacation for the next 2 weeks.
I will look how to implement it when I come back.

@codingseb codingseb self-assigned this Jul 20, 2021
@lofcz
Copy link
Contributor

lofcz commented Jul 20, 2021

@codingseb enjoy your vacation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants