24

Generally, if some object is nested, it is in a hierarchy level below another object. For example:

* Layer 1
  - Layer2

"Layer 2 is nested in Layer 1". What do I call it, if I would "de-nest" Layer 2? Like:

* Layer 1
* Layer 2

I have ... Layer 2.

"De-nesting" sounds made up. "To place beside" would describe it, but I would prefer a similar short and snappy verb like "to nest".

  • Questions which lack results of research are out of scope. Questions that invite many equally valid answers are out of scope. Word or phrase requests are out of scope, unless they are expert-level, particularly interesting, unique, and thought-provoking, and show effort and research. For an introduction to the site, take the Tour. For help writing a good question, see How to Ask. – MetaEd Jul 26 '16 at 18:04
  • 5
    From the title, I thought this was going to be a question about ornithology. – alephzero Jul 26 '16 at 19:08
  • 1
    @alephzero And I thought it was going to be about relationships. – CPerkins Jul 27 '16 at 16:03
88

This is often called flattening. Below is a reference from the Jargon File. Also if you type "flatten list", for example, into Google, you will see that it's a commonly used term.

flatten: vt.

[common] To remove structural information, esp. to filter something with an implicit tree structure into a simple sequence of leaves

[Jargon File]

  • 8
    Flattening is what it is called in just about every computer programming language. – Joshua Robinson Jul 27 '16 at 5:31
  • See: #1 #2 : D – moonwave99 Jul 27 '16 at 9:53
  • 1
    Flattening is generally the best term when you are describing doing it to the entire collection. If being applied only to one or a small number of individual items (leaving others nested), hoisting is probably more appropriate. – Miral Jul 28 '16 at 8:06
18

Unnesting appears to be the antonym:

Nesting and unnesting:

  • The transformation of a nested relation into 1NF is called unnesting.

Nest and Unnest Operators in Nested Relations:

  • By distinguishing nested attributes as Decomposable and Non-Decomposable, it is proved that for all nested relations, unnesting and then renesting on the same attribute yields the original relation subject only to the elimination of duplicate data. Therefore, the statement that was popular in nested relations research: "Unnesting and then nesting on the same attribute of a nested relation does not always yield the original relation" is reconsidered.
13

Since the object in question is moving up the hierarchy one level, you could say that it has been promoted. Eg "Layer 2 was promoted to the top level".

http://www.dictionary.com/browse/promoted

to advance in rank, dignity, position, etc. (opposed to demote ).
  • 1
    This works well, but only if the asker intends to "de-nest" a single item and maintain the rest of the nesting hierarchy. If all items are being promoted to the top level, this term might be confusing (unless maybe the process for doing so involved systematically promoting each item in sequence or something like that). – talrnu Jul 26 '16 at 14:53
  • 1
    @talrnu that's not the example in the question, although I suppose it could be. The question could do with a few more examples to clarify this I think. – Max Williams Jul 26 '16 at 14:55
  • Agreed - hence my upvote for both this and flatten :) – talrnu Jul 26 '16 at 14:56
7

Another option is hoist or hoisting. When you hoist an item in an outline, you are moving it from a deeper branch to be alongside a parent or grandparent branch. It often involves moving all of the children of the selected item as well, grafting the branch further up the tree.

Outliner menu showing the Hoist command

This usage comes from its use in outlining tools such as OmniOutliner, TinderBox, TheOutlinerOfGiants.com or VoodooPad, plus even older tools such as ThinkTank or MORE.

  • 1
    +1 Good find. Links to external resources are encouraged. Feel free for example to quote and link to the online help of any of these outlining tools. – MetaEd Jul 26 '16 at 17:45
  • 1
    OTOH hoist/dehoist may be less familiar for many people. While I'm not native speaker I haven't met the term hoist used in such context. – Maciej Piechotka Jul 27 '16 at 2:23
  • I've seen hoist before, but I would still use promote instead. However, this menu has both "Promote" and "Hoist" entries, would you (or someone) care to explain how they differ? – trentcl Jul 28 '16 at 17:55
  • 1
    @trentcl The difference between Promote and Hoist is what happens to the child nodes of the item. Promote and Demote move the single item to an upper or deeper level. Hoist and De-hoist will take the item and all of the children/branches/leaves below it along for the ride. But at that point you're getting down to application-specific implementation/definitions. – RossO Aug 1 '16 at 22:18
4

I would simply say you unindented Layer 2:

Originated in the 1980s when computers made it trivial for anyone to move text around on a page.

To remove the indentation; to move a block of text closer to the left margin.

I had to unindent the first line of each paragraph so that my essay would fit onto one side of paper.

  • 1
    While not entirely correct, this is much more descriptive and illustrative than many of the other answers. – Mr Lister Jul 26 '16 at 19:58
2

Another word, good only for a certain kind of audience, is flatten. To flatten a list, in certain programming languages, is to remove nesting structure. Thus, for example, in the Mathematica programming language, one begins with the list:

{{a, b}, {c, {d}, e}, {f, {g, h}}}

which has several depths of nesting. Here the braces "{A}" stand for "push"or "indent" object "A" to a one level deeper nesting. A call of the verb "Flatten" i.e.

Flatten[{{a, b}, {c, {d}, e}, {f, {g, h}}}]

outputs the list

{a, b, c, d, e, f, g, h}

and there is a variation where you can specify how many levels of nesting you want to get rid of; for example:

Flatten[{{a, b}, {c, {d}, e}, {f, {g, h}}}, 1]

gets rid of only one level of nesting to output

{a, b, c, {d}, e, f, {g, h}}

The generalization of this idea is to replace recursion by iteration and contrariwise; this is done often to optimize an algorithm for a particular language: imperative languages work best with iteration and functional languages best with recursion. Notwithstanding the heavy usage of this notion of transforming one to the other, there doesn't seem to be a word in general usage in computer science for this notion.

  • This is what the accepted answer says too. – Mr Lister Jul 28 '16 at 12:11
  • @MrLister Thanks, I can't believe I missed that because I thought I'd read them all and went on a considerable search to try to find examples of a word for the more general idea of converting recursion to iteration. I was trawling through Stack Overflow and Wikipedia for quite a while and was surprised there doesn't seem to be a word, or if there is it had eluded the most hardcore nerds at Stack Overflow (which I find unlikely). Actually, on reading the accepted answer, I'm not so sure "flattenning" is so universal amongst computer scientists: only certain languages I've come across seem to .. – WetSavannaAnimal Jul 28 '16 at 12:15
  • ... use the word to describe the notion. – WetSavannaAnimal Jul 28 '16 at 12:16
1

@dangph's answer is excellent in the general use of "nesting.".

For a specific situation, computer programming, let me suggest "unrolling"

specifically in the context of programming in languages with index loops, one might have: (using pseudo-c syntax for concrete examples)

sum = 0.0 for ( i=0, n, i++ ) { for ( j=0, 2, j++ ) { sum = sum + myvector( j*n + i ); } }

could equivalently be replaced with

sum = 0.0 for ( i=0, n, i++) { sum = sum + myvector( i ) + myvector( i + n ) + myvector( i + 2*n ) } }

In this case, we say that where the first example had "nested" loops, the second exmpale has the inner loop "unrolled".

0

ravel:

a : to separate or undo the texture of : unravel

b : to undo the intricacies of : disentangle

When I first learned this word from the J (programming language) dictionary, I found it satisfyingly short and snappy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.