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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ba049bdce87e95c1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-25 23:55:46 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!agate!msuinfo!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!marlin.jcu.edu.au!coral.cs.jcu.edu.au!farrell From: farrell@coral.cs.jcu.edu.au (John Farrell) Subject: Re: Newbie question about generic linked list tasks Message-ID: Sender: news@marlin.jcu.edu.au (USENET News System) Organization: James Cook University References: <35q08a$1e5u@watnews1.watson.ibm.com> Date: 26 Sep 94 06:25:11 GMT Date: 1994-09-26T06:25:11+00:00 List-Id: In <35q08a$1e5u@watnews1.watson.ibm.com> ncohen@watson.ibm.com (Norman H. Cohen) writes: >If I understand your problem, it has nothing to do with generics. You >want to write something like > task type List_Type is > entry Append (Other_List: in List_Type); > -- this := this & Other_List > ... > end List_Type; >but you can't name List_Type in the parameter specification for entry >Append because List_Type doesn't become visible until the end of the >task-type declaration. You got it. >Here is one workaround: > subtype List_Type_Alias is List_Type; > task type List_Type is > entry Append (Other_List: in List_Type_Alias); > ... > end List_Type; Gosh, what a rort! A task type by any other name... >The List_Type_Alias nonsense is a workaround required by RM 9.1(4), which >states that the name of a task unit cannot be used within that unit >itself as a type mark. Three compilers crashed with internal >errors while compiling a variant of this program (with the task body >replaced by a body stub, other ellipses removed, and the generic part >removed), so this may be a legal but unusuable solution. Thanks. This is beginning to sound like Constitutional Law. >Here is another workaround: ... I have to ask - if these things have workarounds, why is the restriction there? Maybe this is more of a newbie question than the original :-). John