Post Reply 
userRPL MAP command observations
03-13-2023, 10:49 AM
Post: #1
userRPL MAP command observations
I used the MAP command very rarely, and I forgot it wanted to change flags, although the 50g advanced user guide v2 manual doesn't tell anything about flags to be set (normally there is a remark about flags).

While searching the web in the hope that someone talked about it, I found this somewhat interesting conversation from 2002: https://groups.google.com/g/comp.sys.hp48/c/84oio2JknbQ (that went off topic after a bit).

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
03-13-2023, 07:05 PM
Post: #2
RE: userRPL MAP command observations
I did not know that MAP affected flags. Which ones?

MAP is also slow, even compared to DOLIST which isn't very fast. Here is a fast replacement for MAP using ListExt commands. It works for matrices or vectors but not for lists. It does not change the type of the array. The function can be a program, a list or a null-tagged object.

Code:

\<< SWAP OBJ\-> DUP \-> s
  \<< LPROD \->LIST SWAP LXEQ s \->ARRY
  \>>
\>>
Find all posts by this user
Quote this message in a reply
03-13-2023, 08:59 PM (This post was last modified: 03-13-2023 09:08 PM by pier4r.)
Post: #3
RE: userRPL MAP command observations
Thanks John for sharing, I'll put it in the collection of code snippets (see wiki4hp). I am not entirely sure which flags it wanted to change, as when I used it today in a program there was a popup asking me flags changes and I clicked cancel. Then I remembered that in the past I used the procedure store the flags, change what map wanted, and then recall the flags again.

For reference, the program was like

Code:

InputList @ a list of reals if I am not wrong
\<<
   IF @yes, IFTE would work too
      maxValue >
   THEN
     1
   ELSE
     0
  END
\>>
MAP

update: added the code here http://www.wiki4hp.com/doku.php?id=rpl:start under JKMAP

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
Post Reply 




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