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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c3109ca91f11de99 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-07 03:29:54 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!priapus.visi.com!orange.octanews.net!news-out.visi.com!petbe.visi.com!news.octanews.net!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Marius Amado Alves Newsgroups: comp.lang.ada Subject: Re: Lists within Lists or Nested Linked Lists... Date: Sun, 7 Mar 2004 11:32:25 +0000 Organization: Cuivre, Argent, Or Message-ID: References: <95941c2c.0403062013.1a9464cd@posting.google.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: melchior.cuivre.fr.eu.org 1078658896 95862 212.85.156.195 (7 Mar 2004 11:28:16 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Sun, 7 Mar 2004 11:28:16 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: X-Mailer: KMail [version 1.3.2] In-Reply-To: <95941c2c.0403062013.1a9464cd@posting.google.com> X-OriginalArrivalTime: 07 Mar 2004 11:27:56.0869 (UTC) FILETIME=[3D23DF50:01C40437] X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:6115 Date: 2004-03-07T11:32:25+00:00 On Sunday 07 March 2004 04:13, Coder87c wrote: > Right now we are doing Lists within Lists or Nested Linked Lists I > cant decided which name is right. Lists_Of_Lists ? > TYPE TaskNode; > TYPE TNodePtr IS ACCESS TaskNode; > TYPE TNode IS RECORD > Name : Positive; > Work : Natural; > Worked : Natural; > Next : TNodePtr; > END RECORD; Why TaskNode *and* TNode? Why not just TaskNode? And the indentation is wrong. > TYPE PNode; > TYPE Scheduler IS ACCESS PNode; > SUBTYPE PNodePtr IS Scheduler; > TYPE PNode IS RECORD > Number : Positive; > TDone : Natural; > TLeft : Natural; > head : TNodePtr; > tail : TNodePtr; > Next : PNodePtr; > END RECORD; > > > So basically if the program was complete the user could assign a > number like > > 1 and have its Tdone be 5 and Tleft be 4 You mean create a PNode object with the specified values for Number, TDone and TLeft? Write a constructor function... > ... > It can also take awwy Tdones.. and list operations. > Now my problem is... How do I simply assign start? Assign what to what? > Like how would a function look like just to assign a number to number? > With no Tdones or Tlefts? Write specialised constructor and/or update operations. > Sorry if this is unclear. Yes, please try to be more rigourous and write better Ada style. Also, an English (but correct) description of the ADT you want to write might assist both yourself and us. Remember an ADT is essentially a set of operations. The auxiliary types and components follow. Think topdown. If the focus of this homework is scheduling and not lists consider using an existing, tried and true, list library, e.g. Charles. Even if the focus is lists, studying the source code of such a library would help. However if you have not learnt generics yet, and don't want to just now, forget this last advice. (It's always nice to see homework efforts on CLA. It's a sign Ada is being taught. However--and this may be the paranoid in me--I tend to interpret some details as weaknesses of the instruction side. For example, the style. If someone is in a condition to ease my mind, please do. For what it matters, I've been an Ada instructor myself.)