1616/****************************************************************/
1717/* Chemistry functions for STACK */
1818/* */
19- /* V1.0 June 2025 */
19+ /* V1.1 June 2026 */
2020/* */
2121/****************************************************************/
2222
@@ -45,6 +45,10 @@ chem_data_units(element, dp) := block([cunit],
4545/* This function returns the units addociated with field "dp". */
4646chem_units(dp) := assoc(dp, zip_with("[", %_CHEM_FIELDS, %_CHEM_UNITS))$
4747
48+ /************************************************************************/
49+ /* This function wraps declaration of the large, static arrays of data. */
50+ /************************************************************************/
51+ stack_chemistry_declare(ex) := block(
4852/*
4953 This is the order of data below. For efficiency, we don't store all the data as nested lists with repeaed fields.
5054 The functions above return formatted data for use with "assoc".
@@ -55,16 +59,14 @@ chem_units(dp) := assoc(dp, zip_with("[", %_CHEM_FIELDS, %_CHEM_UNITS))$
5559 "IonizationEnergy", "ElectronAffinity", "OxidationStates",
5660 "StandardState", "MeltingPoint", "BoilingPoint", "Density",
5761 "GroupBlock", "YearDiscovered"
58- ]$
59-
62+ ],
6063%_CHEM_UNITS : [
6164 null, null, g*mol^(-1), null,
6265 null, null, pm,
6366 J, null, null,
6467 null, K, K, g/cm^3,
6568 null, null
66- ]$
67-
69+ ],
6870/*
6971 Chemical data reformatted from https://pubchem.ncbi.nlm.nih.gov/rest/pug/periodictable/JSON on 2025-06-17.
7072 Missing numerical data is indicated by the atom "null" rather than a zero.
@@ -188,7 +190,7 @@ chem_units(dp) := assoc(dp, zip_with("[", %_CHEM_FIELDS, %_CHEM_UNITS))$
188190 ["Lv", [116, "Livermorium", 293.205, "", "[Rn]7s2 7p4 5f14 6d10 (predicted)", null, null, null, null, "+4, +2, -2", "Expected to be a Solid", null, null, null, "Post-transition metal", 2000]],
189191 ["Ts", [117, "Tennessine", 294.211, "", "[Rn]7s2 7p5 5f14 6d10 (predicted)", null, null, null, null, "+5, +3, +1, -1", "Expected to be a Solid", null, null, null, "Halogen", 2010]],
190192 ["Og", [118, "Oganesson", 295.216, "", "[Rn]7s2 7p6 5f14 6d10 (predicted)", null, null, null, null, "+6, +4, +2, +1, 0, -1", "Expected to be a Gas", null, null, null, "Noble gas", 2006]]
191- ]$
193+ ],
192194
193195/*
194196 Separating the language data in this format makes it easier to add a new language.
@@ -439,5 +441,6 @@ chem_units(dp) := assoc(dp, zip_with("[", %_CHEM_FIELDS, %_CHEM_UNITS))$
439441 ["Ts", "livermorium"],
440442 ["Og", "tennessiini"]]
441443 ]
442- ]$
444+ ]
445+ )$
443446
0 commit comments