david072/funcially

Implement periodic table

Closed this issue · 1 comments

M475R commented

It would be useful for users calculating chemical formulas needing e.g. information, such as ordinal number, mass, molar mass

The elements of the periodic table can be accessed through PT(ordinal number) (output is the name of the element) / PT(name of element) (output is ordinal number of the element) and henceforth be used by PT(ordinal number).m (mass) / PT(ordinal number).Mm (molar mass) / PT(ordinal number).Vm

Thank you for submitting this feature request!

Some critic points:

  • The syntax you proposed is very out of line with the rest of the features in the calculator. Perhaps making separate functions for each of the attributes would be better?
  • As there don't exist strings, you'd have to pre-define a lot of "variables" for every element, potentially making it confusing since you currently also can't re-define standard variables and functions (unlikely that anyone would do this because of capitalisation but should still be considered)
  • Would this only work with atoms or with every chemical class? If so, how would you write the index in e.g. molecules, since subscript numbers are not possible? What about separating the individual atoms so that the calculator knows what's what in the case where there are no indices?

If you can, try to also provide some examples of the usage.