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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: 4 beginner's questions on the PL Ada Date: Fri, 09 Aug 2013 11:29:31 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <87ob96ajv6.fsf@VLAN-3434.student.uu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 9 Aug 2013 18:29:36 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="da68e1c0dc00d4aa5d0283c494e3a17a"; logging-data="22488"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1922vMdaB9rC3EEL4D2JO3STojBsnuOe4c=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <87ob96ajv6.fsf@VLAN-3434.student.uu.se> Cancel-Lock: sha1:TJVyrz6gtIfvKoytWNNuioBesK8= X-Original-Bytes: 2132 Xref: number.nntp.dca.giganews.com comp.lang.ada:182887 Date: 2013-08-09T11:29:31-07:00 List-Id: On 08/09/2013 09:50 AM, Emanuel Berg wrote: > > 3. Is it possible to get the task *name* (from the code) into a > string, programatically? That way, a generic procedure could be > used to communicate from tasks, with Put_Line, and without having > to hard code the task name every time. It's possible to get a name using Ada.Tags.Expanded_Name. The question is what name you get for instances of a task type. GNAT gives the type name regardless of what kind of object the task is (simple object, array component, ...). For an example of using Expanded_Name to obtain this name, see PragmARC.Reflection. The PragmAda Reusable Components are available from http://pragmada.x10hosting.com/pragmarc.htm -- Jeff Carter "Well, a gala day is enough for me. I don't think I can handle any more." Duck Soup 93