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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.171.72 with SMTP id g8mr13243485qaz.7.1376074267216; Fri, 09 Aug 2013 11:51:07 -0700 (PDT) X-Received: by 10.50.55.67 with SMTP id q3mr328903igp.0.1376074267165; Fri, 09 Aug 2013 11:51:07 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.bbs-scene.org!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!f7no1733469qan.0!news-out.google.com!he10ni1155qab.0!nntp.google.com!fx3no1818923qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 9 Aug 2013 11:51:06 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=RxNzCgoAAACA5KmgtFQuaU-WaH7rjnAO NNTP-Posting-Host: 66.126.103.122 References: <87ob96ajv6.fsf@VLAN-3434.student.uu.se> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7a225028-f210-44c5-bd02-0d0eabaebc80@googlegroups.com> Subject: Re: 4 beginner's questions on the PL Ada From: Adam Beneschan Injection-Date: Fri, 09 Aug 2013 18:51:07 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:16731 Date: 2013-08-09T11:51:06-07:00 List-Id: On Friday, August 9, 2013 11:29:31 AM UTC-7, Jeffrey Carter wrote: > On 08/09/2013 09:50 AM, Emanuel Berg wrote: >=20 > > 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. >=20 > It's possible to get a name using Ada.Tags.Expanded_Name. Unless he's declaring a tagged task type (which is possible only by derivin= g it from an interface), there's nothing you can pass as a parameter to Exp= anded_Name. If he's declaring a standalone task object (with an anonymous = type), then I don't think there's a way to do this even if the task is deri= ved from an interface. -- Adam