From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d142408257dde54c,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-28 09:20:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!demon!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news2-win.server.ntlworld.com.POSTED!not-for-mail Reply-To: "Liddle Feesh" From: "Liddle Feesh" Newsgroups: comp.lang.ada Subject: Can someone help me understand this queue package? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: Date: Fri, 28 Dec 2001 17:14:37 -0000 NNTP-Posting-Host: 213.105.185.39 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 1009559699 213.105.185.39 (Fri, 28 Dec 2001 17:14:59 GMT) NNTP-Posting-Date: Fri, 28 Dec 2001 17:14:59 GMT Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:18360 Date: 2001-12-28T17:14:37+00:00 List-Id: 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