comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos" <david.c.hoos.sr@ada95.com>
Subject: Re: Some questions
Date: Thu, 10 Oct 2002 09:36:13 -0500
Date: 2002-10-10T09:36:13-05:00	[thread overview]
Message-ID: <mailman.1034260622.2280.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: 19f3ad7fb9ae3e7dd23e6ce7a7e8ee1a.110780@mygate.mailgate.org


----- Original Message ----- 
From: "Sim Con" <sicon@hotmail.com>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Thursday, October 10, 2002 8:34 AM
Subject: Re: Some questions


> Thanxs for the answer ^_^ but i have another question: 
> my print procedure needs a stack type for work and use some 
> private variable of the generic class so if i define a specific print 
> in other parts (main procedures or in other packages) i receive an
> error, any help? thanx again!! ^_^
Your _specific_ print procedure should only print an _item_ (e.g.,
a float).  Then inside your generic body you have the procedure
that uses the private variables of the generic class, calling your
specific via the formal generic parameter.

Alternatively, and probably better, instead of specifying a
specific _print_ procedure, you could specify an _image_ function
for each item.  That image function would return a string however
you want the item to appear when printed.  Then your generic
print procedure calls that _image_ function when it wants to show
an item.
 




  parent reply	other threads:[~2002-10-10 14:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10 11:17 Some questions Sim Con
2002-10-10 12:27 ` David C. Hoos
2002-10-10 13:34   ` Sim Con
2002-10-10 13:44     ` Colin Paul Gloster
2002-10-10 14:36     ` David C. Hoos [this message]
2002-10-10 14:18 ` Matthew Heaney
replies disabled

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