Skip to content

this.me


this.me / OperatorHandler

Interface: OperatorHandler

Defined in: types.ts:299

Methods

match()

match(call, kernel): OperatorMatch

Defined in: types.ts:308

Return a match if this operator applies to the call. IMPORTANT: matching depends on:

  • operator token at leaf
  • operator registry kind
  • argument shape (string / function / array)
  • whether called at root vs non-root

Parameters

call

OperatorCall

kernel

OperatorKernel

Returns

OperatorMatch


execute()

execute(match, call, kernel): any

Defined in: types.ts:317

Execute behavior. This function may:

  • mutate kernel config (define operator)
  • write memories / encrypt branches / update secrets/noises
  • return a value (root eval/query) or a Memory

Parameters

match
matched

true

token

string

The operator token that matched (e.g. "_", "=")

kind

OperatorKind

The operator kind from the registry

targetPath

SemanticPath

The destination path that should receive the semantic write (operator leaf removed or otherwise transformed). In me.ts this is typically scope.

rewrittenExpression?

any

The expression to write after the operator transforms it. e.g. pointer operator turns expression:string into

memoryOperator?

string

If operator is producing a semantic memory, what should be recorded as operator. (me.ts uses "" for both "" and "->" pointer calls).

returnsValueAtRoot?

boolean

Some operators return a value instead of writing when invoked at root.

  • root "=" thunk returns computed value
  • root "?" returns collected/transformed output
call

OperatorCall

kernel

OperatorKernel

Returns

any