HP Forums

Full Version: RPN and decomposing list to stack
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In RPN, one can combine stacks into a list. Is it possible to decompose a list back into stack?
On the Prime you can return a list but not decompose it. There is no way to return more than a single object to the stack.
Thanks. This is probably a naive question, but can't the list be decomposed sequentially somehow then, or the program can only return one object?

I don't even know how to get an element from a list by hand - SUB was the closest command I could find and it returns single-element list (how to get an element from it, I don't know).
You get the element by direct access (e.g., L1(1) returns the first element of L1.)

This should be explained in the manual under "Lists", but maybe it isn't.
Thanks, Helge!

How would it work with a {list} on stack - would it mean that I have to save it in a global variable first (e.g. L1) to be able to access elements, or somehow decompose the list?

Cheers!
No, in CAS, you can do {1,2,3,4}(3) to retrieve the 3rd element. But in Home, that doesn't work, because of implied multiplication, so there, yes, save it first and then do name().
Reference URL's