Documentation
¶
Overview ¶
Package exprbuiltins is the one list of the reserved built-in expression functions Pulse registers in the shared expr-lang environment (ATTR_FORMULA, FILTER_EXPRESSION, total() arguments and OVERLAY_FORMULA).
Three sites read it and must never drift apart:
- internal/processing registers one expr.Function per name (and its tests pin that every name has an implementation);
- internal/processing's filter-precompute purity check treats every name as a pure function, so a filter calling one keeps the precompute fast path;
- the root package's embedder validation refuses an ExprFunction claiming any name with PULSE_EXTENSION_NAME_RESERVED.
It is a stdlib-free leaf, so the root package and internal/processing both import it without a cycle and without the root reaching the engine.
Adding a function: append its name to [reserved] (keep the group comments), implement it in internal/processing's built-in table, and document it in the expression-language skill. The earlier set helpers (has_any, set_union, ...) and coef / lookup are deliberately absent: they predate the reservation and keep their shadowing semantics.
Index ¶
- Constants
- func IsReserved(name string) bool
- func IsVectorPair(name string) bool
- func MetricFunctionNames() []string
- func Names() []string
- func OverlayAllowed(name string) bool
- func OverlayNames() []string
- func OverlayRefused(name string) bool
- func PreservesLabels(name string) bool
- func SetHelperNames() []string
- type MetricFunction
Constants ¶
const RefFunc = "ref"
RefFunc is the reserved built-in that reads a registered reference vector: ref("table", key).
Variables ¶
This section is empty.
Functions ¶
func IsReserved ¶
IsReserved reports whether name is a reserved built-in expression function.
func IsVectorPair ¶
IsVectorPair reports whether name is a reserved built-in that reads two numeric vectors position by position (dot, dist, cosine).
func MetricFunctionNames ¶
func MetricFunctionNames() []string
MetricFunctionNames returns, in declaration order of [reserved], every reserved built-in that evaluates a registry metric.
func Names ¶
func Names() []string
Names returns a copy of every reserved built-in name, in declaration order.
func OverlayAllowed ¶
OverlayAllowed reports whether OVERLAY_FORMULA may call the reserved built-in name. It is false for every non-reserved name.
func OverlayNames ¶
func OverlayNames() []string
OverlayNames returns a copy of the reserved built-ins OVERLAY_FORMULA may call, in declaration order.
func OverlayRefused ¶
OverlayRefused reports whether name is a reserved built-in that OVERLAY_FORMULA must refuse (reserved, but outside the overlay subset).
func PreservesLabels ¶
PreservesLabels reports whether the reserved built-in name returns a vector labelled exactly like its first argument (vcenter, vzscore, vnormalize).
func SetHelperNames ¶
func SetHelperNames() []string
SetHelperNames returns a copy of the unreserved set helper names, in declaration order.
Types ¶
type MetricFunction ¶
MetricFunction is the linalg/metric registry metric a reserved built-in evaluates and the form it answers in ("distance" or "similarity", the metric.Form spellings: this leaf imports nothing).
func Metric ¶
func Metric(name string) (MetricFunction, bool)
Metric returns the registry metric the reserved built-in name evaluates; false for a name that evaluates none.