Menu

Loop Log in to Edit

Brandon Barker

This page is incomplete, and needs review

This page discusses briefly several mechanisms for using loops in ATS.

Infinitely recursive functions may be a cause for a segfault.
(But sometimes, one may want infinite recursion, as in a main loop; when is it not an issue?) To avoid this possibility, one can take advantage of dependent types and termination metrics, as in this example.

A main loop, useful for creating an application that will keep running until something causes it to return. This can be implemented in several ways.

Firstly,

implement
main () = main() where { ... }

Related

Wiki: Frequently asked questions

Discussion

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.