Next: Continuations Up: Errors Previous: Syntax Errors

## Inferred Value Names

To improve error reporting, names are inferred at compile-time for certain kinds of values, such as procedures. For example, evaluating the following expression: ``

      (let ([f (lambda () 0)]) (f 1 2 3))

produces an error message because too many arguments are provided to the procedure. The error message is able to report ``f'' as the name of the procedure. In this case, MzScheme decides, at compile-time, to name as `f` all procedures created by the `let`-bound `lambda`. Names are inferred whenever possible for procedures, units, classes, and interfaces.

`(inferred-name v)` returns a symbol for the name inferred for v if v has a name, `#f` otherwise. The argument v can be any value. When v is a primitive, `inferred-name` returns the same name as `primitive-name` (see section 4.10.2).