-
Notifications
You must be signed in to change notification settings - Fork 97
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
ExpressionEvaluator method should use IDictionary or IReadOnlyDictionary input type #29
Comments
It's done in dev branch. Will be available in v : 1.3.6.0 It's x = 5 it actually put |
Version 1.3.6.0 is avaiable. Just a comment. A object that inherit from |
I understand that this is not supposed to be a fully sophisticated system,
but it's impressive for what it is. The reason I like it is because of
it's simplistic nature. I'm not planning on using it in production -- but
it's create for quick&dirty research work.
…On Fri, Mar 29, 2019 at 2:06 AM Coding Seb ***@***.***> wrote:
It's done in dev branch. Will be available in v : 1.3.6.0
It's IDictionary<string, object> because when you do :
x = 5
it actually put x in Variables Dictionary.
*Yes I know it's not necessary the best solution and variables scoping is
done the wrong way. But it was the easy way for now. I still have some
improvements in my todo list related to variables management*
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACRjnZUbrtBuVDzM-OJgiJZ_wavy0h1fks5vbdelgaJpZM4cRPfF>
.
|
Small request.
The "ExpressionEvaluator()" method that takes a Dictionary of variables, I'd like to suggest that it instead take IDictionary or, better yet, IReadOnlyDictionary. The reason is because the host code may already have a set of "variables" in a dictionary but the "value" item of each entry is not the variable value, but a different object that contains the value, in addition to other things. Passing that directly to your code wouldn't work because your code expects the Value of the dictionary entry to be an actual intrinsic value such as an int or a double. So today, I have to create a separate dictionary just for the evaluator which is wasteful. If the ExpressionEvaluator code took on an interface instead, I could implement that interface in my object that used the existing dictionary internal to our code.
In general, parameters to methods should be the least simplest form that the code requires. So if your code isn't going to add items to the dictionary, than IReadOnlyDictionary<string, object> is all you need to require.
The text was updated successfully, but these errors were encountered: