Content deleted Content added
Omnipaedista (talk | contribs) already mentioned above |
lint fix, remove <code> tags, adjust table |
||
Line 38:
The data structure of IPL is the list, but lists are more intricate structures than in many languages. A list consists of a singly linked sequence of symbols, as might be expected -- plus some ''description lists'', which are subsidiary singly linked lists interpreted as alternating attribute names and values. IPL provides primitives to access and mutate attribute value by name. The description lists are given local names (of the form 9-1). So, a list called L1 holding the symbols S4 and S5, and described by associating value V1 to attribute A1 and V2 to A2, would be stored as follows. 0 indicates the end of a list; the cell names 100, 101, etc. are automatically generated internal symbols whose values are irrelevant. These cells can be scattered throughout memory; only L1, which uses a regional name that must be globally known, needs to reside in a specific place.
{|style="font-family:monospace; margin: 1em auto"
|+ '''IPL-V List Structure Example'''
|-
Line 60 ⟶ 59:
|203 || V2 || 0
|}
IPL is an [[assembly language]] for manipulating lists. It has a few cells which are used as special-purpose registers. H1, for example, is the program counter. The SYMB field of H1 is the name of the current instruction. However, H1 is interpreted as a list; the LINK of H1 is, in modern terms, a pointer to the head of the call stack. For example, subroutine calls push the SYMB of H1 onto this stack.
|