---
title: Names and help
description: Inspect, list and erase names, and read help
---
## Names

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

```bpl
]help •nc
```

# `•nc` — Name class

`•nc names` gives the class of each name: `¯1` invalid, `0` undefined, `2` value, `3` function, `4` operator. A function glyph or a system name, such as [`+`](https://bpl.fast.ai//glyphs/plus.html) or `•json`, has class `3`. A character vector is one name. [Introspection](introspection.md) has examples.

```bpl
v←1 2 3 ◇ mean←+/÷≢
•nc "v"
•nc "mean" "absent"
```

```output
2ₓ
[3 0]ₓ
```

```bpl
]help •nl
```

# `•nl` — Name list

`prefix •nl classes` lists the visible user names in `classes` that begin with `prefix`, as a sorted vector of strings. `•nl classes` lists them all. [Introspection](introspection.md) has examples.

Errors: `DOMAIN` for unsupported classes; `RANK` for a class matrix.

Shadowed names appear once. Implicit argument and operand names are left out:

```bpl
mean←+/÷≢
"me" •nl 3
"absent" •nl 2 3 4
```

```output
["mean"]
0ρ⊂""
```

```bpl
]help •src
```

# `•src` — Source

`•src name` returns the definition text of a function or operator, including comments. [Introspection](introspection.md) has examples.

Errors: `VALUE` for an undefined name; `DOMAIN` for an argument that isn't a name.

For a primitive or derived function, the BPL representation is returned:

```bpl
f←{≥ω} ◇ add←+
•src "f"
•src "add"
```

```output
"{≥ω}"
"+"
```

```bpl
]help •ex
```

# `•ex` — Erase

`•ex names` erases the nearest binding of each name. An outer binding can then become visible. It returns `1` for each name that it erased or that had no binding, and `0` for an invalid or protected name. [Introspection](introspection.md) has examples.

A function that another name or an array still holds stays usable after its name is erased. `1` is also returned when the name is already absent:

```bpl
v←1
•ex "v"
•ex "v"
•ex "$a"
```

```output
1ₓ
1ₓ
0ₓ
```

## Interactive help

`]help name` shows help in the REPL and in notebooks. A leading [`⍝`](https://bpl.fast.ai//glyphs/lamp.html) comment block inside a definition supplies its help text:

```bpl
mean←{⍝ Mean of a vector
    +/ω ÷ ≢ω}
```

`]help mean` shows the comment:

```bpl
]help mean
```

Calls: `f Y` or `X f Y`

Mean of a vector

Pass `-source` to show the definition:

```bpl
]help mean -source
```

```apl
{⍝ Mean of a vector
    +/ω ÷ ≢ω}
```

`]help` also accepts a glyph and shows the help from its glyph page:

```bpl
]help ?
```

# [`?`](https://bpl.fast.ai//glyphs/question.html) — Predicate

Syntax. Hanzi: `若`

In a dfn, `C?` ends a predicate. When `C` is true, the rest of the body runs. When `C` is false, the next body, after `;`, runs.

```bpl
{ω<0?-ω;ω}¯3      ⍝ 3
{ω<0?-ω;ω}4       ⍝ 4
```

Statements before a predicate run first. After it, a body can run several statements, or hold more predicates.

```bpl
{ω<0?a←-ω ◇ a×2;ω}¯3   ⍝ 6
{ω>0?ω<10?ω;0}15       ⍝ 0
```

`C` must be one truth value (`$t`, `$f`, 1 or 0), or an array holding one. A body that ends after its predicate returns no result. If every predicate fails, the call raises `DOMAIN`. See [Dfns](dfns.md).

In the BPL kernel, press Shift-Tab to inspect the name or glyph at the cursor. Press Tab to complete user names, system names and glyph names typed after a backtick, such as `` `iota ``.

`]help` and Shift-Tab read definitions without executing them. For a dfn, the help shows both call forms, `f Y` and `X f Y`, whether or not the dfn takes a left argument.

[Python](python.md) covers help and completion for Python `Function` objects in IPython.
