X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=sam.git;a=blobdiff_plain;f=fifo.scm;h=14b24f125a320f925b678905fbe10a625cdd3ab7;hp=ab5eda05a5e6e22c945ac83d6f0241746e07c966;hb=ae2621e0018bd23c301f4da4ee1990bb6e02d71f;hpb=bf8a20a40dd9e5d963498a0fe43ef5fea52d07c6 diff --git a/fifo.scm b/fifo.scm index ab5eda0..14b24f1 100644 --- a/fifo.scm +++ b/fifo.scm @@ -2,6 +2,7 @@ (make-fifo fifo-push fifo-pop + fifo-empty? fifo->list) (import scheme @@ -38,6 +39,7 @@ (set! head '()) (set-cell-next! tail '())) (cell-val old-tail))) + ((empty?) (null? head)) ((->list) (let loop ((this-cell head)) (if (null? this-cell) @@ -51,5 +53,8 @@ (define (fifo-pop fifo) (fifo 'pop)) + (define (fifo-empty? fifo) + (fifo 'empty?)) + (define (fifo->list fifo) (fifo '->list)))