From: rgs@k.cs.cmu.edu (Robert Stockton)
Subject: Re: renaming types
Date: Mon, 29-Jun-87 13:16:49 EDT [thread overview]
Date: Mon Jun 29 13:16:49 1987
Message-ID: <1175@k.cs.cmu.edu> (raw)
In-Reply-To: 259760@QZCOM
Using type derivation to achieve renaming can be effective in some cases,
but has its own problems. In particular, it can lead to problems when
dealing with multiple types defined in a single package. Consider the
following case:
package lists is
type List is private;
type List_Iterator is private;
...
function Make_List_Iterator(L : List) return List_Iterator;
private
...
end lists;
with lists; use lists;
package rename_lists is
type New_List is private;
type New_List_Iterator is private;
private
type New_List is new List;
type New_List_Iterator is new List_Iterator;
end rename_lists;
At this point we have derived functions
function Make_List_Iterator(L : List) return New_List_Iterator;
function Make_List_Iterator(L : New_List) return List_Iterator;
Unfortunately, the one we are likely to want to use is
function Make_List_Iterator(L : New_List) return New_List_Iterator;
which is not defined. The only way to make use of the derived function is
to employ an explicit type conversion, which seems unreasonable in this case.
I would be quite pleased if someone could prove me wrong on this point. Am
I missing something?
-Robert Stockton
rgs@spice.cs.cmu.edu
...!seismo!cmu-cs-k!rgs
next prev parent reply other threads:[~1987-06-29 17:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <259745@QZCOM>
1987-06-28 0:08 ` renaming types "Johan Backlund FOA221"
1987-06-29 17:16 ` Robert Stockton [this message]
1987-06-29 13:24 Emery
-- strict thread matches above, loose matches on Subject: below --
1987-06-29 13:07 Emery
1987-06-26 17:28 "Art Evans"
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox