Enclose

, or Box, is a monadic primitive function which creates a nested scalar by wrapping its argument under one level of nesting. When used with function axis, only the selected axes of the given array are enclosed. This can be seen as a more general form of Split, which can only enclose (or split) one selected axis.

Examples
An enclosed array is a scalar, which is subject to scalar extension. This can be used to simulate outer product by a scalar function or one-sided Each (pair the entire right argument with each element of the left argument, or vice versa). A notable application of this behavior is the "chipmunk idiom", which simulates   for (possibly nested) vector Y and simple X.

Enclose with function axis can be used to move one or more axes to an extra level of nesting.

Description
Some implementations allow a simple scalar to be boxed, while the others do not.

Enclose (without axis) is the inverse of Mix and First in the sense that the latter two undo the additional nesting introduced by Enclose.

Documentation

 * Dyalog, with axes
 * APLX
 * J Vocabulary, NuVoc