Doubly-linked list/Definition: Difference between revisions
Content deleted Content added
→{{header|AutoHotkey}}: moved to new url |
Added PicoLisp |
||
Line 759: | Line 759: | ||
2 fwd_pointer handle(Node); |
2 fwd_pointer handle(Node); |
||
</lang> |
</lang> |
||
=={{header|PicoLisp}}== |
|||
For the list of double-cell structures described in |
|||
[[Doubly-linked list/Element definition#PicoLisp]], |
|||
we define a header structure, containing one pointer to the start |
|||
and one to the end of the list. |
|||
+------------> end |
|||
| |
|||
+--+--+-----+ |
|||
| | | ---+---> start |
|||
+-----+-----+ |
|||
<lang PicoLisp># Build a doubly-linked list |
|||
(de 2list @ |
|||
(let Prev NIL |
|||
(let L |
|||
(make |
|||
(while (args) |
|||
(setq Prev (chain (list (next) Prev))) ) ) |
|||
(cons L Prev) ) ) ) |
|||
(setq *DLst (2list 'was 'it 'a 'cat 'I 'saw))</lang> |
|||
For output of the example data, see [[Doubly-linked list/Traversal#PicoLisp]]. |
|||
=={{header|PureBasic}}== |
=={{header|PureBasic}}== |