50

As title, what's the full name for iota (not the usage) in golang:

const (  // iota is reset to 0
    c0 = iota  // c0 == 0
    c1 = iota  // c1 == 1
    c2 = iota  // c2 == 2
)
phuclv
  • 37,963
  • 15
  • 156
  • 475
schemacs
  • 2,783
  • 8
  • 35
  • 53
  • 6
    What do you mean by full name? It's just written as `iota`. – Vale Jul 27 '15 at 10:11
  • I would say that the full name for "iota" is "the predeclared identifier iota" ;) (see here: https://golang.org/ref/spec#Iota), but I'm not sure I understand the question correctly... – rob74 Jul 27 '15 at 10:14
  • @rob74 I would personally call it "auto-incrementing constant", but the official name is still iota. – Vale Jul 27 '15 at 10:16
  • possible duplicate: [What does iota of std::iota stand for?](https://stackoverflow.com/q/9244879/995714), [Why is it Called iota? (duplicate)](https://stackoverflow.com/q/28411850/995714) – phuclv Aug 24 '20 at 07:41
  • "iota" is a word in the English language. I've always thought that iota in golang means iota – slebetman Dec 25 '20 at 15:14
  • 2
    Does this answer your question? [What does iota of std::iota stand for?](https://stackoverflow.com/questions/9244879/what-does-iota-of-stdiota-stand-for) – phuclv Apr 13 '21 at 03:47
  • I think the OP was asking what iota stands for similar to how atoi and itoa stands for ascii to integer and integer to ascii. – whiteSkar Jul 28 '22 at 23:06

4 Answers4

60

That's the full name by itself. "iota" is the letter of the Greek alphabet. It is typical for the math notations:

You can find it in other programming languages as well (see iota in Scheme).

Community
  • 1
  • 1
Alex Netkachov
  • 13,172
  • 6
  • 53
  • 85
  • 4
    Further, it's an [English noun according to Wiktionary](https://en.wiktionary.org/wiki/iota#Noun): "A jot; a very small, inconsiderable quantity." – Dave C Jul 27 '15 at 16:36
  • 1
    I'm only a few days new to golang. while Alex's opinion is correct, the way that golang uses it makes a person think that it stands for "index of the array" since when you reference iota its showing the 0-based index value of when a constant was defined within a list - ergo, index of the array Just my 2 cents =] – Jonathon Hibbard Aug 17 '20 at 12:56
  • 1
    [What does `iota` of `std::iota` stand for?](https://stackoverflow.com/q/9244879/995714) – phuclv Aug 24 '20 at 07:41
  • Yeah I was reading https://golangbyexample.com/iota-in-golang/ and it sounds like it's an acronym because they referred to it as IOTA in all caps. – mareoraft Mar 25 '22 at 16:18
4

iota is not an acronym for something but a word

As others pointed out it is the 9th letter of the Greek alphabet however in english it is also a word with a definition reflective of the Greek letter.

Definition of the word "iota"

From https://www.vocabulary.com/dictionary/iota

If you don't care one iota about something, it means you don’t care about it even one little bit. An iota is something very small.

From https://www.merriam-webster.com/dictionary/iota

an infinitesimal amount : JOT

did not show an iota of interest

If you think of how it is used in Go (golang) that definition fits perfectly, as you are assigning values to constants just to give each constant a unique value so it can be used as a constant. Most often you do not really care what the value is so long as it is unique among that collection of constants

Usage in APL

From http://www.randomprogramming.com/2014/07/algorithms-in-action-iota-and-shuffle/

The Greek letter iota is used in the programming language APL to generate a sequence of consecutive integers.

iota also exists in c++, So there are existing usages in other languages that are similar to Go.

tempcke
  • 700
  • 8
  • 15
3

I think the key point is that iota means the smallest letter of the Greek alphabet, the same meaning as 0 being the smallest value of an enum type.

Quoted from Wiki:

Etymology

From Ancient Greek ἰῶτα (iôta).

(jot): In reference to a phrase in the New Testament: "until heaven and earth pass away, not an iota, not a dot, will pass from the Law" (Mt 5:18), iota being the smallest letter of the Greek alphabet.

Pang
  • 9,564
  • 146
  • 81
  • 122
0

To be simple, it's just a Greek letter, equivalent to English letter "I", but pronounced as "iota", similar to "A" as "alpha".

Nathan W
  • 471
  • 1
  • 7
  • 17