Код Ревью
Сравни свои решения
(define (make-queue)
(define front-ptr '())
(define rear-ptr '())
(define (empty-queue?)
(null? front-ptr))
(define (front-queue)
(cond
[(empty-queue?) (error "DELETE! called with an empty queue")]
[else (mcar front-ptr)]))
(define (insert-queue! item)
(let ([new-pair (mcons item '())])
(cond
[(empty-queue?)
(set! front-ptr new-pair)
(set! rear-ptr new-pair)
#t]
[else
(set-mcdr! rear-ptr new-pair)
(set! rear-ptr new-pair)
#t])))
(define (delete-queue!)
(cond
[(empty-queue?) (error "DELETE! called with an empty queue")]
[else
(set! front-ptr (mcdr front-ptr))
#t]))
(define (dispatch m)
(cond
[(eq? m 'front-queue) (front-queue)]
[(eq? m 'insert-queue!) insert-queue!]
[(eq? m 'delete-queue!) (delete-queue!)]
[else (error "Wrong method")]))
dispatch)