It already is implemented, go ahead and look.
Basically, in pseudocode, without error checks:
int head, tail; array circular_queue;
mixed pop() { wrap( tail+1 ); return circular_queue[tail]; }
void push(mixed v) { wrap( head+1 ); circular_queue[head]=v; }
/ Per Hedbor ()
Previous text:
2003-01-29 11:35: Subject: Re: PCRE again (Was: reasons why pike is better than python?)
and how would you implement that in pike?
greeting, martin.
/ Brevbäraren