Skip to content

#NAME?: an unknown name

#NAME? means that the program uses a name that Vex does not know: an op or a variable. A spreadsheet gives the same code for a function name with a spelling error.

An op that the domain does not declareorigin
app("explode", ref("position"))
step 2 of 2

Result at A: #NAME? the domain "Vec2" has no op "explode"

originABCD
result#NAME? unknown-op#NAME? unknown-op#NAME? unknown-op#NAME? unknown-op

The program applies the op explode to a position. Vec2Domain accepts the position, but it does not declare explode. The message is the domain "Vec2" has no op "explode".

Kind Cause
unknown-op The domain of the receiver does not declare the op. An inherited member, for example toString, is not an op. Also an op without arguments that is not a free function, and an ext kind without a handler.
unbound A var reads a name that no let binds.

._ lists only the ops of the domain of the current value. Thus ._.explode() does not compile. After an op gives a value that no domain of the chain accepts, the chain has no ._.

root.from("position")._.explode(); // type error: Vec2 has no op "explode"
root.from("position")._.length()._.halve(); // type error: halve is not an op of Num

The builder makes the names of with, fork and the axes itself. Thus a program from the builder has no unbound name. The program above is possible only as IR, for example from JSON.

  • Use an op of the domain. The domains page lists the ops of each domain.
  • To add an op, declare it in the ops of the domain. Or set methods: "all", and each method of a value is an op.
  • For a free function, give it in fns: vex(...domains).withOptions({ fns: { myOp } }).

Refer to error values for the other codes.