Function::slot

Details

  • This message is generated when the argument in Slot is not an integer or is negative.
  • Slot[n] can be entered using the notation #n.
  • If Slot is used in a position where it is not evaluated, such as in Function, arguments that might evaluate to integers will not be evaluated unless Evaluate or some other construction is used to cause the evaluation.
  • Off[message] switches off the message; On[message] switches it on. For example: Off[Function::slot].

Examples

Basic Examples  (2)

An error occurs because a symbol is used when a non-negative integer is expected:

This example shows a valid use of Slot in a Function expression:

The error will be generated unless the argument in Slot is a non-negative integer or evaluates to give a non-negative integer:

Valid uses of Slot in a Function expression: