-
Notifications
You must be signed in to change notification settings - Fork 2
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
'Register'-like variable push & pop #1
Comments
Just to log some work-in-progress which I will document some time later One register implementation is
Which is a nice and all, but now we have two storage places for almost the same thing.
See
Code is mvp, runner binary is the only way I have tested it. There are printfs hidden in the rpnlib somewhere and the core implementation uses std::string instead of String since I haven't added testing mock here. Another possible approach is to have separate stacks for each type and force operator to choose which one it wants. This may help avoid |
This turned out in a bit more changes than I originally though. Which are almost done, published this as 0.4.0-pre1 at https://github.com/mcspr/rpnlib Main things that I wanted:
I though about adding unsigned to support bit-wise stuff, but not really sure if it is really needed. There are some subtle bugs (like
|
While it is possible to register variable externally via rpn_variable_set(), it is not possible to store some stack variable or retrieve it later.
Possible syntax:
0 pusha
-> $ra is now 0popa
-> $ra is now unset and 0 is on the stackpeeka
-> $a is still set to 0, 0 is on the stackThe text was updated successfully, but these errors were encountered: