function createFactory( kind ) {
	var f = factory;
	setReadOnly( f, 'free', ndindex.free ); // `free` is a static method
	setReadOnly( f, 'get', ndindex.get ); // `get` is a static method
	return f;

	/**
	* Returns an ndarray index having a specialized "kind".
	*
	* @private
	* @param {ndarray} x - input ndarray
	* @param {Options} [options] - function options
	* @param {boolean} [options.persist=false] - boolean indicating whether to continue persisting an index object after first usage
	* @throws {TypeError} first argument must be an ndarray-like object
	* @throws {TypeError} first argument must be a valid index ndarray
	* @throws {TypeError} options argument must be an object
	* @throws {TypeError} must provide valid options
	* @returns {ndindex} ndindex instance
	*/
	function factory( x ) {
		var options;
		var opts;

		opts = {
			'kind': kind
		};
		if ( arguments.length < 2 ) {
			return new ndindex( x, opts );
		}
		options = arguments[ 1 ];
		if ( !isObject( options ) ) {
			throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
		}
		if ( hasOwnProp( options, 'persist' ) ) {
			opts.persist = options.persist;
		}
		return new ndindex( x, opts );
	}
}
Returns a function for creating ndarray index objects having a specified "kind".

@private
@param {string} kind - specialized index kind
@returns {Function} factory function

@example
var empty = require( '@stdlib/ndarray/empty' );

var cartesianIndex = createFactory( 'cartesian' );
// returns <Function>

var x = empty( [ 3, 2 ], {
    'dtype': 'int32'
});

var idx = cartesianIndex( x );
// returns <ndindex>