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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c76108e955e7f138 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-26 15:16:08 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!diablo.netcom.net.uk!netcom.net.uk!news-hub.cableinet.net!blueyonder!newspeer.clara.net!news.clara.net!news5-gui.server.ntli.net!ntli.net!news6-win.server.ntlworld.com.POSTED!not-for-mail Reply-To: "Liddle Feesh" From: "Liddle Feesh" Newsgroups: comp.lang.ada References: Subject: Re: Why won't this package compile? - ERRORS FIXED & NEW PROBLEMS & New Source Code Listing 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: Wed, 26 Dec 2001 23:10:52 -0000 NNTP-Posting-Host: 213.105.185.39 X-Complaints-To: abuse@ntlworld.com X-Trace: news6-win.server.ntlworld.com 1009408262 213.105.185.39 (Wed, 26 Dec 2001 23:11:02 GMT) NNTP-Posting-Date: Wed, 26 Dec 2001 23:11:02 GMT Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:18317 Date: 2001-12-26T23:10:52+00:00 List-Id: Okay, the package SPEC compiles, and I have saved this as queue_package.ads However - the package body doesn't... I've made the changes as you wonderful people have suggested, but am still erroring... One problem was that I was making package body definitions(?) for a function. The following procedure should not have been included in the package body. It was declared as (and should stay as - a function). procedure is_empty_Queue (q: queue) begin null; -- Do nothing end is_empty_Queue; Removing this removed about 10 errors from the program. The remaining two errors (as reported by ObjectADA 7.2 Compiler) are: Error: Line 6 col 13 ... Completion required for specification 'initialise', Continuing Error: Line 7 col 12 ... Completion required for specification 'is_empty_queue', Continuing is_empty_queue is a function (I hope to iterate through the list, and return boolean true/false if empty), and 'initialise' seems to be properly complete to me. What on earth is the problem here? It's passed me completely. I have attached the queue_package.ads file, which contains both Spec and Body. TIA -- Liddle Feesh ' O 0 o <"//>< ' o'^ (Remove UNDERPANTS to reply) -- START OF FILE --------------------------------------------------------------------- -- Queue_Package Spec --------------------------------------------------------------------- package queue_package is TYPE queue is LIMITED PRIVATE; empty_queue : EXCEPTION; -- !! FIRST ERROR REPORTED HERE -- !! SECOND ERROR REPORTED HERE procedure initialise (q: in out queue); function is_empty_queue (q: 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; -- Queue_Package Body --------------------------------------------------------------------- package body Queue_Package is procedure add (n: in integer; q: in out queue) is begin null; -- Do nothing end add; procedure remove (n: out integer; q: in out queue) is begin null; -- Do nothing end Remove; procedure initalise (q: in out queue) is begin null; -- Do nothing end initalise; end Queue_Package; -- END OF FILE ---------------------------------------------------------------------