home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.modula3
- Path: sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!undergrad.math.waterloo.edu!napier.uwaterloo.ca!papresco
- From: papresco@napier.uwaterloo.ca (Paul Prescod)
- Subject: references, objects & m3
- Message-ID: <C1BsMI.5Ay@undergrad.math.waterloo.edu>
- Sender: news@undergrad.math.waterloo.edu
- Organization: University of Waterloo
- Date: Sat, 23 Jan 1993 21:20:41 GMT
- Lines: 20
-
- I'm using modula-3, and I like it. I've found one thing I can't seem
- to get around.
-
- I've got an _Insert_Bin_Tree function, which inserts "Sortable" objects
- into a binary tree.
-
- I've got "Sortable_Sub" which is a subtype of the sortable object.
-
- The problem is, _Insert_Bin_Tree only takes REFERENCES to Sortable
- objects. It seems like the REFERENCE to a Sortable_Sub is not a
- subtype of the reference to Sortable. Therefore, I can't use narrow.
-
- How can I call _Insert_Bin_Tree then? I've modified _Insert_Bin_Tree,
- but I won't always be able to do that in the future.
-
- Is the only way around it to declare the module unsafe and use the ADR
- operator?
-
- Thanks in advance for any help.
-
-