Anonymous user
Doubly-linked list/Definition: Difference between revisions
Added PicoLisp
(→{{header|AutoHotkey}}: moved to new url) |
(Added PicoLisp) |
||
Line 759:
2 fwd_pointer handle(Node);
</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}}==
|