What counts as public API#
This page says which functions may join the package's public API, such as
to_spec and to_latex. It is not about the operators a model may use; those
are the limits.
A function may join the public API when both of these hold:
- Same file in, same answer out.
to_spec('model.yaml')returns the sameSpectoday, tomorrow, and on a machine with no data and no solver. A function whose answer depends on data, a solver, the network or the clock cannot join. - No rule lives only in the code. Every rule the function applies is written on a page of this reference, so somebody could rewrite the function in another language from the pages alone and get the same answer.
Wherever a feature can be a key in the file, it is one: a key shows up in a git diff, the typesetter prints it, and an engine in another language reads it.
What every function keeps#
- No state. No registry, no plugin, and no setting that changes what a
model means.
symbols=on the typesetter is the shape a legitimate option takes: it changes howloadprints and nothing about whatloadis. - A value or an error, and nothing between.
to_speceither returns aSpecor raises an error that names the rewrite.advice()is separate: it talks about a file the language accepts, and changes nothing. - Nothing is written out unasked. A
piecewise:orsos:block stays the block until a caller callsspec.expand().
What a solver or file format can take, how the numbers bind to the names, and which solver runs are each engine's to decide (what counts as language).