% slices - sequence obtained from slices of an array
%
% slices :: 
%    [[Size,M]->A]	~'array to slices',
% -> seq([[Size]->A]).
%
% slices :: 
%    [Size->A]	~'array to slices',
%    D:natural ~'dimension of desired values'
% -> seq([Size:[[1,D]]->A]).
%
% If 2nd parameter not given, the array is sliced along it's
% last non-singleton dimension, so the element size is the size
% after this dimension has been removed. If given, the dimension
% parameter cannot be smaller than the number of non-singleton
% dimensions in the input.

function y=slices(x,dim), 
	if nargin<2, dim=length(size(x))-1; end
	if isempty(x), y=nil; else y=seq.slices(x,dim); end
end
