Go iota: Difference between revisions
Jump to navigation
Jump to search
Line 11: | Line 11: | ||
=How Does the Compiler Assign Values to <tt>iota</tt> | =How Does the Compiler Assign Values to <tt>iota</tt>= | ||
The compiler parses <code>const()</code> sequences, and each time it encounters a <code>iota</code> constant, it assigns it the zero-based index of the constant, as it appears in the <code>const()</code> sequence. | The compiler parses <code>const()</code> sequences, and each time it encounters a <code>iota</code> constant, it assigns it the zero-based index of the constant, as it appears in the <code>const()</code> sequence. |
Revision as of 19:52, 13 September 2024
External
Internal
Overview
iota
is referred to as an enumerator.
How Does the Compiler Assign Values to iota
The compiler parses const()
sequences, and each time it encounters a iota
constant, it assigns it the zero-based index of the constant, as it appears in the const()
sequence.