Content deleted Content added
→History: Refactoring is not a style of organizing procedural code; it is a method to safely edit a program. |
m →RPL: Some copy editing. |
||
Line 277:
===RPL===
[[Hewlett-Packard|HP]]'s [[RPL (programming language)|RPL]], first introduced in the [[HP-18C]] calculator in 1986, is a type of proprietary hybrid direct-threaded and indirect-threaded threaded-interpreted language that, unlike others TILs, allows embedding of RPL "objects" into the "runstream" ie. The stream of addresses through which the interpreter pointer advances. An RPL "object" can be thought of as a special data type whose in-memory structure contains an address to an "object prolog" at the start of the object, and then data or executable code follows. The object prolog determines how the object's body should be executed or processed. Using the "RPL inner loop",<ref name="RPL1">Busby, Jonathan. [https://www.hpmuseum.org/forum/thread-11358.html "The RPL inner loop explained"], [http://www.hpmuseum.org/ "The Museum of HP Calculators"], 7 September 2018, Retrieved on 27 December 2019</ref> which was invented and published (
# Dereference the IP (
# Increment IP by the length of one address pointer
# Dereference O and store its address in O_1 (
# Transfer control to next pointer or embedded object by setting the PC (
# Go back to step 1
This can represented more precisely by
<pre>
Line 295:
Where above, O is the current object pointer, I is the interpreter pointer, Δ is the length of one address word and the "[]" operator stands for "dereference".
When control is transferred to an object pointer or an embedded object, execution continues as follows
<pre>
|