Memory (Stack, Registers)
How to implement memory
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- Stefano Palazzo
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Implement a stack to be used as follows:
The stack contains all the calculations previously evaluated (rather their result)
The last operation can be referenced with some variable (name?), also there are the common stack operations like push (rather append), pop, swap, and so on.
This is of course very different from rpn and is not to be used extensively (I think). Most repetitive operations can be implemented using generator expressions.
Registers:
Registers can have arbitrary labels, the shall be set using register("A", 292) and accessed using register("A"). This is easy to implement, but not as intuitive as I would want it to be. It will however be a great help when the thing gets to be programmable.
[note: this is just a rough draft]