I'm assuming the "i" is increment and the "a" is assign, but I could not figure out or find the answer. Also, it looks very similar to the non-standard itoa
which I think is confusing.
C++ iota
is not an acronym or an initialism. It is the word “iota”, which is the English spelling of the name of the ninth letter of the Greek alphabet: ι. The lower-case version of the letter is customarily drawn like an English letter i, but without the dot. Depending on your font, the serifs may differ slightly.
The original SGI STL documentation (also mirrored at boost.org) gives this explanation:
The name
iota
is taken from the programming language APL.
Ken Iverson created APL (which stands for “A Programming Language”). In §1.7 “Special vectors” of his 1962 book A Programming Language, he introduced ⍳ (iota) on page 15 as the “interval vector”:
The interval vector ⍳j(n) is defined as the vector of integers beginning with j.
In his 1979 Turing Award lecture, “Notation as a Tool of Thought”, he gave this description of APL's ⍳ function:
For example, the integer function denoted by
⍳
produces a vector of the firstn
integers when applied to the argumentn
, …
So the likeliest answer is that Dr. Iverson wanted a symbol which would remind the user of the word “integer”, the word “interval”, and the use of the letter “i” as a typical integer variable, especially for array subscripting.
Sean Parent suggests that ‘[t]he “ι” symbol was likely chosen because of its use to represent an inclusion map in mathematics.’ He explains his reasoning here.
Sadly, Dr. Iverson died in 2004, several years before this question was even asked on Stack Overflow, so we cannot ask him for a more precise explanation.
By the way, Unicode has two code points for lower-case iota: one for writing Greek and the other for writing APL. The one for writing Greek is ι
, U+03B9, “GREEK SMALL LETTER IOTA”. The one for writing APL is ⍳
, U+2373, “APL FUNCTIONAL SYMBOL IOTA”.
In response to the demands of commenters, I shall further address the etymology of “iota” in this context.
Let's suppose there is a deeper meaning.
According to the Oxford English Dictionary, “iota” is “The name of the Greek letter Ι, ι, corresponding to the Roman I, i; the smallest letter of the Greek alphabet” (smallest physically, not alphabetically, I presume), and also means “The least, or a very small, particle or quantity”. The OED's earliest known usage of this meaning is from Clavis mystica by Daniel Featley in 1636:
Shall we lose, or sleightly pass by, any iota or tittle of the Booke of God?
Clavis mystica describes itself as “a key opening divers difficult and mysterious texts of Holy Scripture”, and this sentence is in particular referring to Matthew 5:18. The 1611 edition of the King James Version has this text for Matthew 5:18:
Transcription:
For verily I say vnto you, Till heauen and earth passe, one iote or one title, shall in no wise passe from the law, till all be fulfilled.
In the original Greek of Matthew 5:18, “iote” is “ἰῶτα”, and “title” (or more modernly, “tittle”) is “κεραία”. The word “κεραία” meant, roughly, “serif” or “apostrophe”. So this Bible verse is referring to the idea of the smallest details, and using “ἰῶτα” to refer to the letter iota in its role as the physically smallest letter of the Greek alphabet.
Featley, as a Bible scholar (he earned a Doctorate of Divinity), could undoubtedly read Greek. I guess he just transliterated the Greek name for the letter, “ιώτα”, into English “iota”. Why didn't he follow the King James translation's spelling, “iote“? I don't know.
Thus we may deduce that the STL function iota
, and its APL antecedent ⍳
, are named, by way of the Bible, after the physically smallest letter of the Greek alphabet “ι”, because these functions produce integers separated by the smallest amount by which integers may be separated.
According to Wikipedia, The Greek letter iota came from the Phoenician letter yōdh.
This is as far afield of programming as I currently wish to go for this question.