3 ms·
http://www.google.co.uk/#q=%22enumeration+type%22 http://www.google.co.uk/#q=%22enumeration+type%22 http://en.wikipedia.org/wiki/Enumerated_type http://en.wiki
by RiderOfGiraffes 16y ago
http://www.google.co.uk/#q=%22enumeration+type%22 http://www.google.co.uk/#q=%22enumeration+type%22
http://en.wikipedia.org/wiki/Enumerated_type http://en.wikipedia.org/wiki/Enumerated_type
http://en.wikibooks.org/wiki/Ada_Programming/Types/Enumeration http://en.wikibooks.org/wiki/Ada_Programming/Types/Enumerati...
In essence, an "enumerated type" is a collection of uninterpreted values. You can assign them to variables, you can compare them to each other, but they have no intrinsic structure. Unlike ints you can't add or multiply, unlike strings you can't concatenate or search for substrings.
Hence the observation that symbols are not strings, but are elements of an infinite enumerated type. You can only refer to them, copy them, assign them, and compare them. They are atomic.
No disrespect intended - different people have different backgrounds, and I know some very fine coders who don't know this sort of thing - but this is very, very elementary CS material, and easily found with a Google search. You may find it interesting to learn more about these sorts of basics. Although it often doesn't help directly, it can provide useful insights to have different points of view and points of reference.
- lispm 16y agoI know what enumeration types are. Symbols are not directly an 'enumerated type', but can be used to implement them. Like symbols can be used for many other things. Thinking of symbols as elements of 'infinite enumerated type' is misleading or useless. In Common Lisp symbols are not just a name, but part of a namespace (package), have a value, a function, a property list, etc.. They can only be kind of enumerated if they are part of a package. Symbols can also be not interned in a package, then you can't enumerate them.