periodic-table
An essential part of any general chemistry program is the periodic table of the elements. Nobody wants to copy the whole thing by hand, and figuring out how to represent it can be a minor headache. Therefore, you should download the periodic-table library. It is fully asdf-installable and has been tested without any problems on SBCL and LispWorks.

The home page is https://common-lisp.net/project/chemboy/

Example

(use-package :elements)

;; Get the name of the element which has the symbol "Kr"
(element-name (symbol-element "Kr")) => "Krypton"

;; It isn't case sensitive
(element-name (symbol-element "kR")) => "Krypton"

;; Find the element with the electronegativity closest to 4.0
(electronegativity-element 4.0)
=>
#S(ELEMENT
   :NAME "Fluorine"
   :ATOMIC-WEIGHT 18.9984
   :ATOMIC-NUMBER 9
   :OXIDATION-STATES "-1"
   :BOILING-POINT 85.0
   :SYMBOL "F"
   :ELECTRONEGATIVITY 3.98)

;; Get an element from its atomic number
(element-symbol (get-element 12)) => "Mg"

;; Demonstrate another use of the powerful GET-ELEMENT function.
;; Boiling point is in Kelvins
(element-boiling-point (get-element 'nitrogen)) => 77.344

It is released under the LLGPL.


science