Re: Why no relative pointer in RPL Message #2 Posted by C.Ret on 10 Mar 2010, 11:25 a.m., in response to message #1 by David Hayden
Hye,
There is several simple ways to evaluate an object in RPL via a relative address. I may missing same thing about the XLIB and LAM object you speak about.
As far as I understand indirect reference mechanisms, the following RPL codes are all indirect reference to object in the XLib list :
Suppose the following list of objects store in XLib { 10 20 30 [1 2 3] [[7 8 9][4 5 6][1 2 3]] "Any Text" « DUP PRG » (12,3) 12.3_feet #adress ...} 'XLib' STO
To evaluate the object at the relative adress n, simply GET it ! 'XLib' n GET EVAL
Ex. 'XLib' 5 GET EVAL or 'XLib(5)' EVAL returns "Any Text"
And, a more relative adress can be used using any supplementary Index :
Ex. { 3 5 2 4 6 7 6 3 9 } 'Index' STO then 'Xlib' 'Index' 2 GET GET returns "Any text"
Or several as need :
Ex. [ 1 2 3 4 5 1 2 3 4 5] 'PostIndex' STO tehn 'XLib' 'Index' 'PostIndex' 7 GET GET GET returns "Any Text"
And so on...
So, it looks to be easy and simple to make relative, relative indexed, relative multi indexed references in RPL !
No extra "pointer" object is required as any list, array or matrix may be used as a pointer table.
I certainly missing samething there and I may mistaken which XLIB, LAM or prolog's nibble you speak about.
Can you please be a bit more explicit concerning the HP49g's aplets jump table ?
|