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

[FUTURE][SYSTEMML-2078] Add support for global variables #754

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EdgarLGB
Copy link
Member

@EdgarLGB EdgarLGB commented Apr 2, 2018

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

@akchinSTC
Copy link
Contributor

Can an Admin verify this patch?

@mboehm7
Copy link
Contributor

mboehm7 commented Apr 6, 2018

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.

@krishnakalyan3
Copy link
Member

krishnakalyan3 commented May 16, 2018

@EdgarLGB things look good :). Tested global-variables-test.dml.

I was wondering why you choose to use + operator instead of a function call.

Eg:

gv = 10
setglobal(gv) or
global gv

@EdgarLGB
Copy link
Member Author

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.

@krishnakalyan3
Copy link
Member

@EdgarLGB thanks for the clarification.

@j143
Copy link
Contributor

j143 commented Apr 28, 2020

Hi @Baunsgaard and @kev-inn , would you investigating this PR.
Is this changeset in line with systemds direction.

cc @EdgarLGB

@mboehm7
Copy link
Contributor

mboehm7 commented May 1, 2020

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.

@j143 j143 changed the title [SYSTEMML-2078] Add support for global variables [FUTURE][SYSTEMML-2078] Add support for global variables May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Unplanned
Development

Successfully merging this pull request may close these issues.

5 participants