Code

The customer portal and the accounting application both display the amount still owed on an invoice. They use the same invoice and payment records, but their answers can differ if they treat pending credits differently. Sharing the records has not supplied a shared definition of the calculation. If each team maintains its own version, every policy change introduces another opportunity for disagreement.

The calculation belongs with the knowledge it interprets. An expression can define the amount still owed as part of the dataset, available for different applications to use. The teams can examine that definition and agree on how it treats a credit. Their choice of application language does not have to determine the meaning of the answer.

Homoiconicity

Homoiconicity means that code has the same forms as ordinary data. A calculation can therefore be something an application examines and changes, just as it examines other information. Its structure is available as data rather than being meaningful only to the application that authored it. This extends Reification from named operations to the calculations those operations depend on.

Suppose the team changes when a credit reduces the amount owed. The invoice and credit records can remain unchanged while the calculated balance changes. The calculation's earlier definition is then part of explaining the earlier answer. Keeping its evolution alongside the facts lets the team examine both the information it had and the interpretation it used.

Macros

Macros codify shared helpers that queries, mutations, and other expressions can use. A helper for deciding whether a credit applies can keep that rule consistent wherever an invoice balance is calculated. The team can examine and change the helper's definition alongside the rules that depend on it. Repeated decisions become shared concepts instead of separate copies of the same logic.

Those helpers can also form a domain-specific language, or DSL, for the business. A payment rule could refer to concepts such as "credit applies" or "ready for payment" without repeating every underlying condition. Teams can express larger rules using the vocabulary they use to discuss their work. The helpers give that vocabulary explicit definitions that people can examine and agree on.