Doubly-linked list/Element definition: Difference between revisions
Doubly-linked list/Element definition (view source)
Revision as of 21:42, 8 February 2017
, 7 years ago→{{header|PhixI}}
(Added Bracmat example) |
|||
Line 573:
}
}</lang>
=={{header|Phix}}==
In Phix, types are used for validation and debugging rather than specification purposes. For extensive run-time checking you could use
<lang Phix>enum NEXT,PREV,DATA
type slnode(object x)
return (sequence(x) and length(x)=DATA and <i>udt</i>(x[DATA]) and integer(x[NEXT] and integer(x[PREV]))
end type</lang>
But more often you would just use the builtin sequences. See also [[Singly-linked_list/Element_definition#Phix|Singly-linked_list/Element_definition]].
Memory is automatically reclaimed the moment items are no longer needed.
=={{header|PL/I}}==
|