-
Notifications
You must be signed in to change notification settings - Fork 481
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
[FUTURE][SYSTEMML-2078] Add support for global variables #754
base: main
Are you sure you want to change the base?
Conversation
Can an Admin verify this patch? |
Sorry for the late response but I would like to play around with this a bit before doing the review. I'll come back to this in a few days. |
@EdgarLGB things look good :). Tested I was wondering why you choose to use Eg:
|
Thanks @krishnakalyan3 for testing! In fact, my idea is to define a global variable and check if it is modified after the function call which tries to modify the global variable. And I'm not sure that I understand your question. Well, I used it for concatenating the string. |
@EdgarLGB thanks for the clarification. |
Hi @Baunsgaard and @kev-inn , would you investigating this PR. cc @EdgarLGB |
Meanwhile, I think not supporting global variables might be better in the long run as it keeps functions (except for explicit reads/writes) side-effect free. Back when discussing this feature, it included two sub problems (1) builtin global constants like NaN, PI, INF, as well as (2) different function scoping rules (with global access). Since (1) has already been introduced (see 4a822a2) and meanwhile we extended the list functionality to pass parameters easier along function call graphs, there is no more a real need for globals. However, I would leave this PR open, in case we come back to it - then this would be an excellent starting point. |
Hi,
Here is a PR for adding support of global variables. We can define variables in global scope or function scope. For a function call, it can reference variables from its parent scope, i.e., global or its superior function scope.
Thanks for review