You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be very convenient to add a Scope support into Interpreter. Consider the following snippet:
recordPerson(stringName,stringGender,intAge);varinterpreter=new Interpreter();// this is a proposed Scope feature
interpreter.UseScope<Person>();varperson=new Person("Ulrich","Male",30);varlambda= interpreter.Parse("Gender == \"Male\" && Age >= 30");
Assert.True(lambda.Invoke(person));
So it looks like a this reference that is implicitly passed when calling class methods.
Although I can pass a person object itself as a variables - this will make the expression more complex i.e. "person.Gender == \"Male\" && person.Age >= 30" what is less convenient and not concise.
The text was updated successfully, but these errors were encountered:
ealeykin
changed the title
Parser Scope identifier support
Interpreter Scope identifier support
Mar 19, 2022
Yes, similar requirement came up also in the past, like #18 (back in 2014 ;-) ).
I agree that in some context it could be nice, on the other end it could add some complexity in the parser ... If you find some nice way to implement this feature I think it could be added.
It would be very convenient to add a Scope support into Interpreter. Consider the following snippet:
So it looks like a
this
reference that is implicitly passed when calling class methods.Although I can pass a person object itself as a variables - this will make the expression more complex i.e.
"person.Gender == \"Male\" && person.Age >= 30"
what is less convenient and not concise.The text was updated successfully, but these errors were encountered: