ⓘ Nesting, computing. In computing science and informatics, nesting is where information is organized in layers, or where objects contain other similar objects. I ..


ⓘ Nesting (computing)

In computing science and informatics, nesting is where information is organized in layers, or where objects contain other similar objects. It almost always refers to self-similar or recursive structures in some sense.

Nesting can mean:

  • recursive calls
  • nested calls
  • using several levels of subroutines
  • nested data structures such as records, objects, classes, etc.
  • nested function definitions with lexical scope
  • nested blocks of imperative source code such as nested if-clauses, while-clauses, repeat-until clauses etc.
  • information hiding
  • nested levels of parentheses in arithmetic expressions
  • nested virtualization, also called recursive virtualization: running a virtual machine inside another virtual machine

1. In spreadsheets

In a spreadsheet functions can be nested one into another, making complex formulas. The function wizard of the OpenOffice.org Calc application allows to navigate through multiple levels of nesting, letting the user to edit and possibly correct each one of them separately.

For example:

=IFSUMC8:G8=0,"Y", "N")

In this Microsoft Excel formula, the SUM function is nested inside the IF function. First, the formula calculates the sum of the numbers in the cells from C8 to G8. It then decides whether the sum is 0, and it displays the letter Y if the sum is 0, and the letter N if it is not.

Naturally, to allow the mathematical resolution of these chained or better: nested formulas, the inner expressions must be previously evaluated, and this outward direction is essential because the results that the internal functions return are temporarily used as entry data for the external ones.

Due to the potential accumulation of parentheses in only one code line, editing and error detecting or debugging can became somehow awkward. That is why modern programming environments -as well as spreadsheet programs- highlight in bold type the pair corresponding to the current editing position. The automatic balancing control of the opening and closing parenthesis known as brace match checking.


2. In programming

Control Structures

In structured programming languages, nesting is related to the enclosing of control structures one into another, usually indicated through different indentation levels within the source code, as it is shown in this simple BASIC function:

In this small and simple example, the conditional block" if. then. end if” is nested inside the" do while. loop” one.

Some languages such as Pascal and Ada have no restrictions on declarations depending on the nesting level, allowing precisely nested subprograms or even nested packages Ada. Here is an example of both simplified from a real case:

Data Structures

Nested data structures are also commonly encountered in programming.


In the functional programming languages, such as Lisp, a list data structure exists as does a simpler atom data structure.

  • Simple lists hold only atoms.

The atoms in the list are A, T, O, M, and S.

  • Nested lists hold both atoms and other lists.
  • Nesting may refer to: Building or having a nest Nesting instinct, an instinct in pregnant animals to prepare a home for offspring Nesting computing
  • arbitrarily deep nesting Other data representations are restricted to one level of nesting such as INI file s section name value. Attribute computing Entity attribute value
  • purpose - built nesting houses, usually reinforced concrete structures following the design of the Southeast Asian shop - house rumah toko ruko These nesting houses
  • In computing algorithmic skeletons, or parallelism patterns, are a high - level parallel programming model for parallel and distributed computing Algorithmic
  • together with the nesting depth of each parenthesis, then the match to each open parenthesis is the next close parenthesis with no larger nesting depth, so it
  • star to drive computer systems. This concept derives its name from the nesting Russian Matryoshka dolls. The concept was deployed by its inventor, Robert
  • In parallel computing the fork join model is a way of setting up and executing parallel programs, such that execution branches off in parallel at designated
  • has adaptable and multiple nesting capabilities, which allows multiple programs to run at once, while utilizing 2 - way nesting MM5 features inputs from
  • Inner class Nesting computing Rothwell, Trevis J. 2011 The GNU C Reference Manual. Free Software Foundation, Inc. p. 63. Re: Nesting functions - Why
  • Karp s 21 problems are shown below, many with their original names. The nesting indicates the direction of the reductions used. For example, Knapsack was