comp.lang.ada
 help / color / mirror / Atom feed
From: "Bob McChesney" <bob@teambob.freeserve.co.uk>
Subject: Re: Trouble with renaming types
Date: Tue, 8 May 2001 18:12:21 +0100
Date: 2001-05-08T17:11:21+00:00	[thread overview]
Message-ID: <9d99bp$oi4$1@newsg1.svr.pol.co.uk> (raw)
In-Reply-To: %oVJ6.129347$xN4.8316100@news1.sttls1.wa.home.com

Hmm, maybe I'm doing it wrong then...

When I use the 1st method (i.e. new type of WordSet.Set) what you said about
inherited procedures doesn't seem to hold for me.

eg, I've instantiated WordSet.

So ... in WordSet I have:
a type defined called Set
a procedure Add(Set, Word)

I've made type Dictionary a new WordSet.Set (which it allows no problem).

BUT when I try and do:

WordSet(Dictionary, Word) I get the compilation error:

Expected private type "Set" .... found private type "Dictionary".

Any ideas?

Thanks
Bob

"Mark" <up.yerz@nospam.com> wrote in message
news:%oVJ6.129347$xN4.8316100@news1.sttls1.wa.home.com...
>
> "Bob McChesney" <bob@teambob.freeserve.co.uk> wrote in message
> news:9d949f$kto$1@newsg1.svr.pol.co.uk...
> > Oh, forgot to mention, I'm not using:
> >
> > 'type Dictionary is new WordSet.Set'
> >
> > because when I do that all the functions of WordSet cannot operate on
type
> > Dictionary.
>
> Yes and no... subprograms defined immediately within Wordset, if they
> operate on type Set, are "primitive operations" of Set and will be
inherited
> (think of that as "duplicated") for type Dictionary.
>
> But subprograms defined elsewhere that operate operate on Set are not part
> of type Set, so they can't be inherited by Dictionary.
>
> >
> > What I need is to be able to give type WordSet.Set a new name, but still
> > allow all oof the WordSet functions/procedures to be able to work on it.
> >
>
> To "alias" a type with an interchangeable name, say this:
>
>     subtype Dictionary is Wordset.Set;
>
> (note, no "new" in there... :-)
>
> Have fun,
> -- mark
>
>
>





  reply	other threads:[~2001-05-08 17:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-08 15:37 Trouble with renaming types Bob McChesney
2001-05-08 15:45 ` Bob McChesney
2001-05-08 16:45   ` Mark
2001-05-08 17:12     ` Bob McChesney [this message]
2001-05-09 13:18 ` Stephen Leake
2001-05-09 15:22   ` Bob McChesney
  -- strict thread matches above, loose matches on Subject: below --
2001-05-09  4:59 Christoph Grein
2001-05-09 15:15 ` Bob McChesney
replies disabled

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