Anonymous user
Doubly-linked list/Element definition: Difference between revisions
Doubly-linked list/Element definition (view source)
Revision as of 21:22, 25 May 2009
, 15 years ago→E: crosslink, lang tag
(→E: crosslink, lang tag) |
|||
Line 96:
=={{header|E}}==
This does no type-checking, under the assumption that it is being used by a containing doubly-linked list object which enforces that invariant along with others such as that <code>element.getNext().getPrev() == element</code>. See [[Doubly-Linked List#E]] for an actual implementation (which uses slightly more elaborate nodes than this).
def element {
to setValue(v) { value := v }
to getValue() { return value }
to setNext(n) { next := n }
to getNext() { return next }
to setPrev(p) { prev := p }
to getPrev() { return prev }
Line 111:
return element
}</lang>
=={{header|Fortran}}==
|