pub fn evaluate_spec(
spec_text: &str,
kernel: &dyn Lookup,
) -> Result<Vec<Value>, EmbeddingError>Expand description
Evaluate a comprehension clause’s spec text against a Lookup scope.
Steps:
interpolate_via_kernelresolves{name}placeholders against the kernel’s in-scope name space (own outputs + inherited extern values).- Try
dsl::compile::eval_const_expr_for(…, kernel.ledger())on the result. On success with aStrvalue, re-parse as a comma-separated list with per-element type detection. Other typed variants become a single-element typed list. - On eval failure (most common case for literal lists like
"1, 10"which aren’t valid Polydat const expressions), fall back toparse_list_with_typeson the interpolated text —1→U64,1.5→F64,true→Bool, anything else →Str.
Errors propagate from interpolation (unresolved placeholder, runaway round count, etc.) — those are the user-facing actionable diagnostics.