These are chat archives for symengine/symengine

16th
Feb 2018
Björn Dahlgren
@bjodah
Feb 16 2018 14:25
What is the best way to cast from Basic* to Symbol*?
Think I got it: rcp_static_cast<const Symbol>(s)
Björn Dahlgren
@bjodah
Feb 16 2018 15:11
I'd like to use the parser to parse some strings. In chemistry it is often common to name things with e.g. plus and minus signs in the names (e.g. "H+", "OH-", "Na+" etc.). However it is also common to denote concentrations using square brackets: "[H+]", "[OH-]" etc. So I'd like to add such a rule. I suppose the simplest way is for me to just copy parser.cpp and modify it as a local copy in my project?
Björn Dahlgren
@bjodah
Feb 16 2018 15:19
Thinking about this some more I think I will just add pre- and post-processing of strings with eg. regex's to turn names e.g. [H+] into __conc__H_plus (and reserve the use of underscore prefix to the implementation)