Doubly-linked list/Definition: Difference between revisions
Content added Content deleted
m (Switched Fortran with F# and PL/I with PicoLisp to restore alphabetic order) |
|||
Line 923: | Line 923: | ||
loop_foreach_previous( Fun, Next ) -> Next ! {foreach_previous, Fun}. |
loop_foreach_previous( Fun, Next ) -> Next ! {foreach_previous, Fun}. |
||
</lang> |
</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Fortran}}== |
=={{header|Fortran}}== |
||
Line 1,142: | Line 1,173: | ||
</pre> |
</pre> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Go}}== |
=={{header|Go}}== |
||
Go has nothing like an enforced invariant. Responsibility for preventing circular loops must be shared by all code that modifies the list. Given that, the following declaration ''enables'' code to do that efficiently. |
Go has nothing like an enforced invariant. Responsibility for preventing circular loops must be shared by all code that modifies the list. Given that, the following declaration ''enables'' code to do that efficiently. |
||
Line 1,610: | Line 1,612: | ||
<pre>0 1 2 40 41 42 |
<pre>0 1 2 40 41 42 |
||
42 41 40 2 1 0</pre> |
42 41 40 2 1 0</pre> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |
||
Line 1,641: | Line 1,635: | ||
(setq *DLst (2list 'was 'it 'a 'cat 'I 'saw))</lang> |
(setq *DLst (2list 'was 'it 'a 'cat 'I 'saw))</lang> |
||
For output of the example data, see [[Doubly-linked list/Traversal#PicoLisp]]. |
For output of the example data, see [[Doubly-linked list/Traversal#PicoLisp]]. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|PureBasic}}== |
=={{header|PureBasic}}== |