DOSUBS with binary operations
|
05-15-2022, 11:56 AM
Post: #1
|
|||
|
|||
DOSUBS with binary operations
In an older thread I stumbled upon the following program:
Code: \<< Compared to my original program I noticed that \<< CROSS \>> can be replaced by :: CROSS: Code: \<< But then I noticed that also 2 was missing. This surprised me since I wasn't aware that the frame index could be omitted. It turns out that this doesn't work for :: DROP but only with operations that operate on two objects like :: + or :: ^. Furthermore, it also works when these operations are wrapped within a code object like \<< CROSS \>>. However, the following doesn't work: Code: { 0 1 4 9 16 25 } We get: DOSUBS Error: Invalid User Function But we can use: Code: { 0 1 4 9 16 25 } Or then of course: Code: { 0 1 4 9 16 25 } Which returns the expected result: Code: { 1 3 5 7 9 } Please excuse my ignorance but is this behaviour described in the manuals? At least in the HP 48G Series User's Guide I couldn't find anything. Or is it just folklore like the null-tag trick? Addendum: It also works for more than two arguments as long as they are declared: Code: { 1 2 3 4 5 } The result is: Code: { 9 20 35 } It appears to work with DOLIST as well, which is nice. However, while it works with \<< * \>> it doesn't work with :: *. We get: DOLIST Error: Bad Argument Type |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
DOSUBS with binary operations - Thomas Klemm - 05-15-2022 11:56 AM
RE: DOSUBS with binary operations - Joe Horn - 05-15-2022, 12:15 PM
RE: DOSUBS with binary operations - Thomas Klemm - 05-15-2022, 01:44 PM
RE: DOSUBS with binary operations - John Keith - 05-15-2022, 06:27 PM
RE: DOSUBS with binary operations - Thomas Klemm - 05-15-2022, 08:48 PM
|
User(s) browsing this thread: 1 Guest(s)