Singly-linked list/Traversal: Difference between revisions
→{{header|ATS}}
Line 512:
=={{header|ATS}}==
I repeated the [[Singly-linked_list/Element_definition#ATS|‘Rosetta Code linear list type’]] here, so you can simply copy
the code below, compile it, and run it.
Also I put the executable parts in initialization rather than the main program,
to avoid being forced to ‘consume’ the list (free its memory). I felt that would be a distraction.
The traversal function is proven to terminate.
<lang ATS>(*------------------------------------------------------------------*)
Line 597 ⟶ 606:
implement
main0 () = ()</lang>
{{out}}
<pre>$ patscc -DATS_MEMALLOC_LIBC singly_linked_list_traversal.dats && ./a.out
123
456
789</pre>
=={{header|AutoHotkey}}==
|