From: "Liddle Feesh" <no_see_reply_address@spam.com>
Subject: Can someone help me understand this queue package?
Date: Fri, 28 Dec 2001 17:14:37 -0000
Date: 2001-12-28T17:14:37+00:00 [thread overview]
Message-ID: <nM1X7.50394$US4.8861952@news2-win.server.ntlworld.com> (raw)
Essentially, I have a spec, and I'm trying my damndest to write a body for
it - and though I've tried (hence my previous two posts here), I'm still
quite stuck, with only a very basic stub compiling.
Does anyone have any decent queue tutorials? I've tried looking for a few on
the net - adapower, an ada program (console), and several books... However
when it comes to queues I'm none-the-wiser...
Looking at the pointers - is this some sort of linked list?
Could someone be so kind as to convert the following package into
pseudo-code for me?
Thanks in advance
--
Liddle Feesh
' O 0 o <"//>< ' o'^
(Remove UNDERPANTS to reply)
package queue_package is
-- queue type definition
TYPE queue is LIMITED PRIVATE;
empty_queue : EXCEPTION;
procedure initialise (q: in out queue);
-- function mode 'in' added. Although the mode of all parameters must be
'in' for
-- functions, it's always a good idea to show explicitly.
function is_empty_queue (q: in queue) return boolean;
procedure add (n: in integer; q: in out queue);
procedure remove (n: out integer; q: in out queue);
--remove raises the exception "empty-queue" if applied to an empty queue
PRIVATE
TYPE node;
TYPE link is ACCESS node; --ACCESS is a pointer type
TYPE node is RECORD
value : integer;
next : link :=NULL;
END RECORD;
TYPE queue is RECORD
head : link;
tail : link;
END RECORD;
END queue_package;
---------------------------------------------------------------------
X-No-Archive: Yes
next reply other threads:[~2001-12-28 17:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-28 17:14 Liddle Feesh [this message]
2001-12-28 18:16 ` Can someone help me understand this queue package? Michal Nowak
2001-12-28 22:57 ` Liddle Feesh
2001-12-29 11:35 ` Michal Nowak
2001-12-29 19:37 ` Liddle Feesh
2001-12-29 20:05 ` Michal Nowak
2001-12-29 20:44 ` Liddle Feesh
2001-12-29 22:02 ` Liddle Feesh
2001-12-30 13:14 ` Michal Nowak
2001-12-30 22:28 ` Liddle Feesh
2001-12-31 10:32 ` Michal Nowak
2001-12-29 17:13 ` Liddle Feesh
2001-12-29 18:42 ` martin.m.dowie
2001-12-29 19:09 ` Liddle Feesh
2001-12-29 17:13 ` Liddle Feesh
2001-12-29 17:13 ` Liddle Feesh
2001-12-29 17:14 ` Liddle Feesh
2001-12-29 17:39 ` Liddle Feesh
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox