-;;; queue.el --- queue data structures
-
+;;; queue.el --- Queue data structure -*- lexical-binding: t; -*-
;; Copyright (C) 1991-1995, 2008-2009, 2012 Free Software Foundation, Inc
;; Author: Inge Wallin <inge@lysator.liu.se>
;; Toby Cubitt <toby-predictive@dr-qubit.org>
-;; Version: 0.1
+;; Maintainer: Toby Cubitt <toby-predictive@dr-qubit.org>
+;; Version: 0.1.1
;; Keywords: extensions, data structures, queue
;; URL: http://www.dr-qubit.org/emacs.php
;; Repository: http://www.dr-qubit.org/git/predictive.git
;;; Commentary:
;;
-;; A queue can be used both as a first-in last-out (FILO) and as a first-in
-;; first-out (FIFO) stack, i.e. elements can be added to and removed from the
-;; front or back of the queue.
+;; These queues can be used both as a first-in last-out (FILO) and as a
+;; first-in first-out (FIFO) stack, i.e. elements can be added to the front or
+;; back of the queue, and can be removed from the front. (This type of data
+;; structure is sometimes called an "output-restricted deque".)
;;
;; You create a queue using `make-queue', add an element to the end of the
;; queue using `queue-enqueue', and push an element onto the front of the
;; package.
-
;;; Code:
(eval-when-compile (require 'cl))
(pop (queue-head queue)))
-(defmacro queue-empty (queue)
+(defun queue-empty (queue)
"Return t if QUEUE is empty, otherwise return nil."
(null (queue-head queue)))
-(defmacro queue-first (queue)
+(defun queue-first (queue)
"Return the first element of QUEUE or nil if it is empty,
without removing it from the QUEUE."
(car (queue-head queue)))