From: Greg Bond <bond@ee.ubc.ca>
Subject: Re: How to print Task_ID type? (GNAT SunOS)
Date: 1996/04/04
Date: 1996-04-04T00:00:00+00:00 [thread overview]
Message-ID: <31642F61.1D2B@ee.ubc.ca> (raw)
In-Reply-To: dewar.828631235@schonberg
Robert Dewar wrote:
>
> Greg asks
>
> "Can one of the Text_IO packages be used to print a Task_ID type (or any
> access Integer type for that matter...)? I'm using GNAT under SunOS
> which defines the Task_ID type in Ada.Task_Identification as private,
> but implements it as an Integer access type. If one of the Text_IO
> packages won't work, then what will?"
>
> Certainly not, private means private, neither you nor Text_IO can
> mess with a private type in another package. Well you culd use
> unchecked conversion after looking in the private part, but that
> would NOT be pleasant code.
>
> What do you really need to do here? Doesn't the Image function for
> Task_Id do what you want? That's what it's for!
>
> function Image (T : Task_Id) return String;
Indeed it is. My oversight. This function does not handle the more
general problem I posed though. Is there a general facility for printing
access types? The GNAT implementation of the Image function above is a
system level (i.e. platform dependent) routine specifically for the
Task_ID type. The only Ada references I've got are Barnes for Ada 95 and
the ALRM, both of which are woefully inadequate on the topic of Ada I/O.
--
* Greg Bond * Dept. of Electrical Eng.
* email: bond@ee.ubc.ca * Univ. of British Columbia
* voice: (604) 822 0899 * 2356 Main Mall
* fax: (604) 822 5949 * Vancouver, BC
* web: http://www.ee.ubc.ca/~bond * Canada, V6T 1Z4
next prev parent reply other threads:[~1996-04-04 0:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-04-03 0:00 How to print Task_ID type? (GNAT SunOS) Greg Bond
1996-04-04 0:00 ` Robert Dewar
1996-04-04 0:00 ` Greg Bond [this message]
1996-04-05 0:00 ` Robert Dewar
1996-04-05 0:00 ` Keith Thompson
1996-04-05 0:00 ` Robert Dewar
1996-04-06 0:00 ` Keith Thompson
1996-04-06 0:00 ` Robert Dewar
1996-04-07 0:00 ` Keith Thompson
1996-04-05 0:00 ` Greg Bond
1996-04-04 0:00 ` Greg Bond
1996-04-05 0:00 ` Laurent Guerby
1996-04-04 0:00 ` Joel Sherrill
1996-04-06 0:00 ` Fergus Henderson
1996-04-06 0:00 ` Robert Dewar
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox