src/stdlib/sequence.c
/*=======================================================
 *  hdelseq -- Remove and return element at sequence head
 *=====================================================*/
- Remove and return element at sequence head
- Remove and return element at sequence head
ELEMENT
hdelseq (SEQUENCE seq)
{
	INT i, n;
	ELEMENT e, *d;
	seqerr = NONE;
	if ((n = Size(seq)) == 0)  {
		seqerr = EMPTY;
		return (ELEMENT) 0;
	}
	d = Data(seq);
	e = d[0];
	for (i = 1; i < n; i++)
		d[i-1] = d[i];
	--Size(seq);
	return e;
}
ELEMENT hdelseq ( SEQUENCE seq ) { INT i , n ; ELEMENT e , * d ; seqerr = NONE ; if ( ( n = Size ( seq ) ) == 0 ) { seqerr = EMPTY ; return ( ELEMENT ) 0 ; } d = Data ( seq ) ; e = d [ 0 ] ; for ( i = 1 ; i < n ; i ++ ) d [ i - 1 ] = d [ i ] ; -- Size ( seq ) ; return e ; }
hdelseq -- Remove and return element at sequence head
hdelseq -- Remove and return element at sequence head