What does "turtle all the way down" mean?

I often hear this phrase and do not quite understand its meaning. What does it mean? And if possible, is there an example?

Thank you!

+6
source share
4 answers

One use of this expression refers to a programming style where there is a very deep call stack. You can see the method called Grobble and wonder what it does, so you open the definition and see this:

 class FooHandler { void Grobble(Foo foo) { foo.Grobble(); } } 

So you look at Foo.Grobble :

 class Foo { FooImpl _fooImpl; void Grobble() { _fooImpl.Grobble(); } } 

This also makes you FooImpl look like this:

 class FooImpl { void Grobble() { this.Grobble(false); } // etc... } 

After you go deeper and deeper into the code, you still cannot see the end, you are allowed to be disappointed: "These turtles are completely down!"

A link to the Earth's metaphor is on the back of the turtle. What is a turtle worth? Another turtle ... etc.

+11
source

This usually refers to self-hosting languages, where the interpreter or compiler is written in the same language that is interpreted / compiled. It can also reference libraries for a language written in the language itself.

Smalltalk and Lisp are well known for this kind of thing.

+3
source

It is sometimes used to refer to "pure" object-oriented (or functional) languages. In ao java, C #, C ++, Objective c and Delphi, there are native types (int) that do not behave like objects. Illusion is supported much better in Smalltalk.

+1
source

Tortoises all the way down is a phrase sometimes used to denote infinite recursion. For example, what is the smallest integer? Not. -2 less than -1, -3 less than -2, etc. There is no bottom. The original source of the quote was the answer to the question "If the world is on the back of the turtle, what is the turtle worth?" In any case, it does not have any programming-specific meaning that I know of.

0
source

Source: https://habr.com/ru/post/923203/


All Articles