What is the “atom” data type?

前端 未结 4 740
星月不相逢
星月不相逢 2021-02-01 16:57

I have encountered the ATOM type in the Win32api and also in the Acrobat API there is ASAtom.

As far as I can tell, atoms are keys for a hash table usually

4条回答
  •  说谎
    说谎 (楼主)
    2021-02-01 17:19

    The earliest thing I can find about the term "atom" is from the Lisp programming language (source). However, it probably originally came from mathematical logic. In programming they are also called Symbols and at its simplest form are name integers (an enumerated type in C would be an example). However, they are widely used in many programming languages and in the Win32 API and Acrobat API they are identifiers for strings in a table.

    Also, as Mehrdad points out, the original meaning in Greek is "indivisible", so they imply a primitive data type which cannot be broken down any further.

提交回复
热议问题