简体   繁体   中英

What's the full name for `iota` in golang?

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
)

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 ).

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.

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.

简单来说,它只是一个希腊字母,相当于英文字母“I”,但发音为“iota”,类似于“A”为“alpha”。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM