Recursive Objects

Data Structures

A recursive object is one such that one of it's parts is itself of the same type as the main object. I know, it sounds weird.

In fact, is very simple. Imagine a function that has a function inside. A piece of text with a quote (a text inside a text). That's recursion.

This containment cannot be literally defined (in any language), as the members of a record must be defined before you can use them inside the record. A record cannot use itself directly.

To link units we use of an abstraction called accesses (they work as directions that point to another node).

Usually "Pointers" are an advanced feature for other languages, as well as "recursive objects". This is a gentle introduction, but you may find more information in the Guide for Programmers: Accesses(Pointers)

Recursive structures can be used for dynamic memory management. This means that instead of keeping aside a huge part of memory in case you may use it, you use these structures to only use the memory you need.

Linked Lists

The most simple recursive type consist in nodes linking the next node.

Just like a train links wagons.