Skip to content

treat symbols symbolically when converting from expressions #304

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

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

adediego
Copy link
Contributor

Before when calling e.g. convert(Expression, :(x+y)), the values of the variables x and y were interpolated into the resulting expression from global scope. With this PR, they are treated as Variables.

@ChrisRackauckas
Copy link
Member

I remember now that the issue with this is that functions will be treated like variables if you do it like this.

@adediego
Copy link
Contributor Author

Aren't functions always the first element of the args field of an expression when they are called? Above in line 5 and 6, the convert function only descents into args[2:end] and evals the first argument. Or am I missing a case where you want to treat a symbol that is not the first argument as a function?

@ChrisRackauckas
Copy link
Member

Oh I see, yes.

@ChrisRackauckas ChrisRackauckas merged commit 7820927 into SciML:master Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants