home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / modula3 / 1140 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.1 KB  |  31 lines

  1. Newsgroups: comp.lang.modula3
  2. Path: sparky!uunet!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!undergrad.math.waterloo.edu!napier.uwaterloo.ca!papresco
  3. From: papresco@napier.uwaterloo.ca (Paul Prescod)
  4. Subject: references, objects & m3
  5. Message-ID: <C1BsMI.5Ay@undergrad.math.waterloo.edu>
  6. Sender: news@undergrad.math.waterloo.edu
  7. Organization: University of Waterloo
  8. Date: Sat, 23 Jan 1993 21:20:41 GMT
  9. Lines: 20
  10.  
  11. I'm using modula-3, and I like it.  I've found one thing I can't seem
  12. to get around.
  13.  
  14. I've got an _Insert_Bin_Tree function, which inserts "Sortable" objects
  15. into a binary tree.
  16.  
  17. I've got "Sortable_Sub" which is a subtype of the sortable object.
  18.  
  19. The problem is, _Insert_Bin_Tree only takes REFERENCES to Sortable
  20. objects.  It seems like the REFERENCE to a Sortable_Sub is not a
  21. subtype of the reference to Sortable.  Therefore, I can't use narrow.
  22.  
  23. How can I call _Insert_Bin_Tree then?  I've modified _Insert_Bin_Tree,
  24. but I won't always be able to do that in the future.
  25.  
  26. Is the only way around it to declare the module unsafe and use the ADR
  27. operator?
  28.  
  29. Thanks in advance for any help.
  30.  
  31.