MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / evaluateStatements

Function evaluateStatements

src/compute-engine/function-utils.ts:312–330  ·  view source on GitHub ↗
(
  ce: ComputeEngine,
  ops: Iterable<Expression>
)

Source from the content-addressed store, hash-verified

310
311/** True when `result` is the inert application that `literal` itself answers
312 * for an argument whose type does not decide an annotation. An inner literal
313 * can answer such a node as the value of the body of `literal`: that is a
314 * value of `literal`, and the call of `literal` does not wait. */
315export function isUndecidedLiteralApplication(
316 result: Expression | undefined,
317 literal: Expression
318): boolean {
319 return (
320 result !== undefined &&
321 UNDECIDED_APPLICATIONS.has(result) &&
322 isFunction(result, 'Apply') &&
323 result.op1 === literal
324 );
325}
326
327/***
328 * ### THEORY OF OPERATIONS
329 *
330 * The body of a `["Function"]` expression is a `["Block"]` expression,
331 * which is scoped. The function arguments are declared in that scope as well.
332 *
333 * Some expressions with anonymous parameters (e.g. `["Add", "_", 1]`)

Callers 2

evaluateBlockFunction · 0.90
invokeFunction · 0.85

Calls 3

isFunctionFunction · 0.90
evaluateMethod · 0.65
exprMethod · 0.65

Tested by

no test coverage detected