Sebastian Walz 9f7b02e1cd
Tohu vaBohu
2023-04-03 14:38:02 +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;
}