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

Pop and swap #5

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

Conversation

stevemolloy
Copy link
Contributor

The rpn calculator that comes with elegant includes pop and swap commands for manipulating the stack. These are heavily used in the defns.rpn file that ships with elegant, and so will be needed to allow that file to be run. More updates will be needed to allow that file to be interpreted properly by pyrpn, however this is (hopefully) a good start. :)

@stevemolloy
Copy link
Contributor Author

The "13 commits" that appear in this are mostly me rebasing your work onto mine. The only real change is b0c86f9

@zhangt58
Copy link
Owner

The feature of parsing a similar file as .defns.rpn is great. I'm OK with this PR. The original idea is any string like sqrt or pop could be just treated as a function, and the logic of the function is separated from solve method, such that the solve method will not grow too much. I've updated the solve logic to correctly handle pop operations (these operations do not have returned value to push back the stack), could you please check this PR #6?

@zhangt58
Copy link
Owner

I've merged #6, would you please resolve the conflicts, then this PR could be merged.

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.

None yet

2 participants