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,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8a3e2ce4e6d56336 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-09 14:56:02 PST Path: supernews.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!fr.usenet-edu.net!usenet-edu.net!enst!enst.fr!not-for-mail From: "Beard, Frank" Newsgroups: comp.lang.ada Subject: RE: Generic Formal Parameter for a Task Type Date: Fri, 9 Mar 2001 17:53:21 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: avanie.enst.fr 984178446 10237 137.194.161.2 (9 Mar 2001 22:54:06 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 9 Mar 2001 22:54:06 +0000 (UTC) To: "'comp.lang.ada@ada.eu.org'" Return-Path: X-Mailer: Internet Mail Service (5.5.2448.0) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: supernews.google.com comp.lang.ada:5589 Date: 2001-03-09T17:53:21-05:00 -----Original Message----- From: Tucker Taft [mailto:stt@averstar.com] > Why not have a formal function that returns the Task_ID, rather > than 'Terminated? That way, you can use the Ada.Task_Identification > and Ada.Task_Attributes packages to get whatever else you need from the > task, including task attributes... Good idea. It didn't cross my mind. I still think too much in Ada 83 terms. > If you wanted to avoid generics, you could define an abstract limited > tagged type (say "Has_Task") which had various (abstract) primitive > operations, including at least a "Task_ID" function. You would then > extend from this type by adding a component of the task type of interest > (and of course override the abstract primitives as appropriate). > You could then manipulate objects of type Has_Task'Class, or references > there-to, in a "Java"-like way ;-). You could also pass in any > extension of Has_Task to a generic with a formal tagged derived type > of "type My_Task is new Has_Task with private;". Yeah! Whatever you said.