Saved in:
Bibliographic Details
Main Author: Allison, Lloyd
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2403.01866
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929263974809600
author Allison, Lloyd
author_facet Allison, Lloyd
contents A circular program creates a data structure whose computation depends upon itself or refers to itself. The technique is used to implement the classic data structures circular and doubly-linked lists, threaded trees and queues, in a functional programming language. These structures are normally thought to require updatable variables found in imperative languages. For example, a functional program to perform the breadth-first traversal of a tree is given. Some of the examples result in circular data structures when evaluated. Some examples are particularly space-efficient by avoiding the creation of intermediate temporary structures which would otherwise later become garbage. Lastly, the technique can be applied in an imperative language to give an elegant program.
format Preprint
id arxiv_https___arxiv_org_abs_2403_01866
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Circular Programs and Self-Referential Structures
Allison, Lloyd
Programming Languages
D.1; E.1
A circular program creates a data structure whose computation depends upon itself or refers to itself. The technique is used to implement the classic data structures circular and doubly-linked lists, threaded trees and queues, in a functional programming language. These structures are normally thought to require updatable variables found in imperative languages. For example, a functional program to perform the breadth-first traversal of a tree is given. Some of the examples result in circular data structures when evaluated. Some examples are particularly space-efficient by avoiding the creation of intermediate temporary structures which would otherwise later become garbage. Lastly, the technique can be applied in an imperative language to give an elegant program.
title Circular Programs and Self-Referential Structures
topic Programming Languages
D.1; E.1
url https://arxiv.org/abs/2403.01866