[GAP Forum] List with Holes

Sven Reichard reichard at maths.uwa.edu.au
Fri Mar 23 04:24:44 GMT 2007



Bruce Colletti wrote:
> If X is a list with holes, how do I find the positions of the holes?
> 
> Thankx.
> 
> Bruce
> 

The following does it:

gap> list := [,,4];
[ ,, 4 ]
gap> holes := Filtered([1..Length(list)], y -> not IsBound(list[y]));
[ 1, 2 ]

Cheers,
Sven.



More information about the Forum mailing list