Jump to content

Doubly-linked list/Element definition: Difference between revisions

→‎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).
 
<lang e> def makeElement(var value, var next, var prev) {
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}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.