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

print (2x) (x + 2) as 2x (x + 2) #72

Open
evykassirer opened this issue Sep 4, 2017 · 2 comments
Open

print (2x) (x + 2) as 2x (x + 2) #72

evykassirer opened this issue Sep 4, 2017 · 2 comments

Comments

@evykassirer
Copy link
Contributor

print (2x) (x + 2) as 2x (x + 2)

I don't think 2x needs parens - it's already seen as a unit imo - and I think it's like another 'being aware of coefficients' thing and that the brain really does parse it differently

You noted that for this change we'd want to make sure we can maintain the invariant that parse(mathStr) == parse(print(parse(mathStr)))

(this isn't super high priority for me since it doesn't come up that much)

@kevinbarabash
Copy link
Member

@evykassirer to verify the AST that we want to print is:

(mul (mul 2 x) (add x 2))

@evykassirer
Copy link
Contributor Author

yup!

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

No branches or pull requests

2 participants