Sebastian Walz 860d31cee1
Tohu vaBohu
2023-04-21 00:22:52 +02:00

22 lines
643 B
Nix

{ core, document, ... } @ libs:
let
inherit(core) debug string type;
format
= compound:
type.matchPrimitiveOrPanic compound
{
string = "\\directlua{chem.compounds.texPrint([[${compound}]])}";
list = "\\directlua{chem.compounds.texPrint([[${string.concatWith "||" compound}]])}";
};
from
= compound:
{
input = compound;
__toString = { input, ... }: format input;
};
in
{
inherit format from;
__functor = { ... }: from;
}