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

Added toString function to Expression #47

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ron99
Copy link

@ron99 ron99 commented Aug 13, 2015

The function converts the Expression object back to the original string which he was built from, without saving it.

The returned string is trimmed and built with specific rules when to use parenthesis, so it can be little different from the original expression string, but it will be formatted well.

I'm currently working on implicit multiplication option for the function (to use only when it's logical in the expression).

@fasseg
Copy link
Owner

fasseg commented Aug 14, 2015

@ron99: Thanks for you contribution. One question though: If you require this feature why not just save the original value in a String var in the Expression object?

@ron99
Copy link
Author

ron99 commented Aug 14, 2015

I built this function because I was building a derivative function for the expression (almost finish), and I wanted to see the result in a clear way, not thru a list of tokens.
This is also useful after the expression was going thru some optimization, and you want to see the result.

The expression is trimmed, formatted in a fixed structure and convert all implicit multiplication to regular multiplication, so it displayed in the most readable way.

@fasseg
Copy link
Owner

fasseg commented Nov 20, 2015

I have scheduled time to roll a new release next week, and will consider merging this into master.

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