Location: src/lang/Interpreter.cpp (Interpreter::evaluate), src/csg/CsgEvaluator.cpp (existing statement-form dispatch).
Real OpenSCAD (since 2019.05) allows assert()/echo() in expression position, most commonly for inline validation at the top of a function body:
function f(x) = assert(x > 0, "must be positive") x * 2;
ChiselCAD currently only supports both as statements — dispatched in CsgEvaluator, which owns the diagnostics/echo-message sink. A function body only ever reaches Interpreter::evaluate, which has no diagnostic channel at all today, so this isn't a small callBuiltin addition — it needs a diagnostics/echo sink threaded through every Interpreter::evaluate call site.
Why this matters for real-world scripts: this pattern is common in library code (e.g. BOSL2-style parameter validation) that guards a function's inputs before computing. A script that uses a library written this way will fail wherever the library relies on it.
Originally noted as a deferred gap in docs/roadmap.md (now trimmed); filing as a tracked issue instead.
Location:
src/lang/Interpreter.cpp(Interpreter::evaluate),src/csg/CsgEvaluator.cpp(existing statement-form dispatch).Real OpenSCAD (since 2019.05) allows
assert()/echo()in expression position, most commonly for inline validation at the top of a function body:ChiselCAD currently only supports both as statements — dispatched in
CsgEvaluator, which owns the diagnostics/echo-message sink. A function body only ever reachesInterpreter::evaluate, which has no diagnostic channel at all today, so this isn't a smallcallBuiltinaddition — it needs a diagnostics/echo sink threaded through everyInterpreter::evaluatecall site.Why this matters for real-world scripts: this pattern is common in library code (e.g. BOSL2-style parameter validation) that guards a function's inputs before computing. A script that
uses a library written this way will fail wherever the library relies on it.Originally noted as a deferred gap in
docs/roadmap.md(now trimmed); filing as a tracked issue instead.