comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Package instance???
Date: Thu, 14 Feb 2002 09:41:42 -0500
Date: 2002-02-14T14:41:43+00:00	[thread overview]
Message-ID: <a4gib7$fr6$1@nh.pace.co.uk> (raw)
In-Reply-To: fFFa8.54055$AV5.312647@rwcrnsc51.ops.asp.att.net


"Steve Doiel" <nospam_steved94@attbi.com> wrote in message
news:fFFa8.54055$AV5.312647@rwcrnsc51.ops.asp.att.net...
>
> And then you can define:
>
>   p1 is new My_Package;
>   p2 is new My_Package;
>
Syntax check: Should be "package p1 is new My_Package;" - but see below.


> Which will create two instances of a My_Package.
> I don't know your background, but if you have C++ for comparison a generic
> in Ada is kind of like a template in C++, not an object.
>
I strongly suspect from the way the question was stated that Mr. Yates
(first or last name?) was trying to duplicate what can be done with a C++
class - that is, have a bunch of variables bundled together with some
operations and make several instances of the set of variables. While, yes,
you *can* get a similar effect using generics - that doesn't seem to be what
is being called for. I'd suggest that generics best be left out of it for
the time being because its a little tricky for a newbie.

It would help if we got a little better description of what the desired
behavior is so we can suggest the proper Ada idiom for getting there.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/





  reply	other threads:[~2002-02-14 14:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-13 19:48 Package instance??? Yates
2002-02-13 22:25 ` Zach Swanson
2002-02-13 22:31 ` Jeffrey Carter
2002-02-14  2:28   ` Zach Swanson
2002-02-14 14:32     ` Marin David Condic
2002-02-14  2:04 ` Bobby D. Bryant
2002-02-14  2:54 ` Steve Doiel
2002-02-14 14:41   ` Marin David Condic [this message]
2002-02-15  2:13     ` Steve Doiel
2002-02-14 12:48 ` Marc A. Criley
2002-02-14 15:09 ` Yates
2002-02-14 18:12 ` 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