Post Reply 
RPN and decomposing list to stack
08-03-2014, 03:56 PM
Post: #1
RPN and decomposing list to stack
In RPN, one can combine stacks into a list. Is it possible to decompose a list back into stack?
Find all posts by this user
Quote this message in a reply
08-07-2014, 01:54 PM
Post: #2
RE: RPN and decomposing list to 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.

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
Find all posts by this user
Quote this message in a reply
08-08-2014, 04:22 AM
Post: #3
RE: RPN and decomposing list to 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).
Find all posts by this user
Quote this message in a reply
08-08-2014, 02:24 PM
Post: #4
RE: RPN and decomposing list to stack
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.
Find all posts by this user
Quote this message in a reply
08-09-2014, 10:59 AM
Post: #5
RE: RPN and decomposing list to stack
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!
Find all posts by this user
Quote this message in a reply
08-09-2014, 02:59 PM
Post: #6
RE: RPN and decomposing list to stack
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().
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)