comp.lang.ada
 help / color / mirror / Atom feed
From: farrell@coral.cs.jcu.edu.au (John Farrell)
Subject: Re: Newbie question about generic linked list tasks
Date: 26 Sep 94 06:25:11 GMT
Date: 1994-09-26T06:25:11+00:00	[thread overview]
Message-ID: <farrell.780560711@coral.cs.jcu.edu.au> (raw)
In-Reply-To: 35q08a$1e5u@watnews1.watson.ibm.com

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



  parent reply	other threads:[~1994-09-26  6:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <farrell.780154278@coral.cs.jcu.edu.au>
     [not found] ` <35qb51$ksu@rational.rational.com>
1994-09-22 17:55   ` Newbie question about generic linked list tasks Bob Kitzberger
     [not found] ` <EACHUS.94Sep21134917@spectre.mitre.org>
     [not found]   ` <farrell.780237190@coral.cs.jcu.edu.au>
1994-09-23 10:53     ` Robert I. Eachus
1994-09-26  5:52       ` John Farrell
1994-09-26  9:55         ` Robert I. Eachus
1994-09-27  5:37           ` John Farrell
1994-09-28 22:15             ` David Weller
     [not found] ` <35q08a$1e5u@watnews1.watson.ibm.com>
1994-09-26  6:25   ` John Farrell [this message]
1994-09-26  9:44     ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox