Post Reply 
hp 50G SysRPL linked arrays
08-08-2018, 03:07 AM
Post: #4
RE: hp 50G SysRPL linked arrays
(08-08-2018 02:18 AM)Claudio L. Wrote:  It's been a long time so I might be wrong but I vaguely recall trying to use linked arrays and no commands supported them. It seems the object type was created but never actually used for anything in the ROM.

OK, we're both wrong Smile -- it's somewhere between what we both said. I just got lucky on the first few I tried, and subsequently fell into the "assumption trap". The following is not an exhaustive test, but I did at least check the following:

^ARSIZE: works
^MDIMS: doesn't work
MDIMSDROP: doesn't work
PULLREALEL: doesn't work
PUTEL: doesn't work
PUTREALEL: doesn't work

I stopped checking after that. GETATELN is probably the most important, as it has to abide by the offset list to gain access to the individual elements. The size/dimension commands only look at the fields that are presumably in the same place (and usage) in both formats, but MDIMS/MDIMSDROP are SysRPL programs that have no dispatch for the LNKARRY type and thus throw a "bad argument type" error.

The PULL/PUT commands appear to assume that the argument is a standard array (with no pointers are present), and thus fall apart miserably if called. The result can leave things in a very bad state, with an imminent crash likely.

So I was perhaps hasty in my suspicion of more widespread support, but since LNKARRYs are best thought of as read-only anyway, the ones that do work might be enough for a determined SysRPL programmer.

That said, I'm still not sure that there's much reason to use them! The limited testing I did a long time ago (on a 50g) didn't show any appreciable difference in performance for the things I tried. I probably didn't throw any really large arrays at it, though. It's too much hassle to create them manually, so it wasn't easy to test. The only advantage I can see is if you need to create an array for internal use that has lots of duplicates (see the earlier example for how that can save space), or perhaps if you have some use for an array of strings that you need to access faster than a sequential skip would allow.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
hp 50G SysRPL linked arrays - Podalirius - 08-07-2018, 01:32 PM
RE: hp 50G SysRPL linked arrays - DavidM - 08-08-2018, 01:55 AM
RE: hp 50G SysRPL linked arrays - DavidM - 08-08-2018 03:07 AM

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