home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12510 < prev    next >
Encoding:
Text File  |  1992-08-18  |  2.8 KB  |  71 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!caen!hellgate.utah.edu!fcom.cc.utah.edu!swillden
  3. From: swillden@news.ccutah.edu (Shawn Willden)
  4. Subject: Re: Tagged Pointers
  5. Message-ID: <1992Aug18.180444.20262@fcom.cc.utah.edu>
  6. Sender: news@fcom.cc.utah.edu
  7. Organization: University of Utah Computer Center
  8. X-Newsreader: Tin 1.1 PL3
  9. References: <1992Aug18.013357.19262@ucc.su.OZ.AU>
  10. Date: Tue, 18 Aug 92 18:04:44 GMT
  11. Lines: 58
  12.  
  13. maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  14. : In article <1992Aug17.174931.1376@fcom.cc.utah.edu> swillden@news.ccutah.edu (Shawn Willden) writes:
  15. : >
  16. : >Hmmm.  It appears I didn't explain myself very well because that is
  17. : >precisely what *I* was suggesting.  I suppose the difference lies in
  18. : >my consideration of TP's and TU's as different types but (as I said)
  19. : >
  20. : >    1)    *TP yields a TU
  21. : >    2)    &TU yields a TP
  22. : >
  23. : >whereas you suggested that they not be actual *types* but that we 
  24. : >make them work like the above anyway.  Same effect, different words.
  25. : >Have I got this right?
  26. :     I'll have to think on this carefully, everytime I try
  27. : to reply I get confused :-)
  28.  
  29. You're not alone... :-)
  30.  
  31. : >:     So the issue is whether a tagged pointer is a proper type
  32. : >: or just a sort of syntactic sugaring that supports a new 
  33. : >: mechanism for genericity. My thinking was the latter.
  34. : >
  35. : >I think your thinking is better :-)  TP couldn't be a proper type
  36. : >anyway.  If anything, TP would be a *family* of types.
  37. : > 
  38. : >:     Any comments?
  39. : >
  40. : >Actually, does it really matter whether we call [T1,T2,T3]& a ref to 
  41. : >a tagged union or a tagged ref?
  42. : >
  43. :     Yes. The compiler has to know where to find the tag,
  44. : next to the pointer, or where the pointer is pointing.
  45. : The rule has to be next to the pointer. So taking the address
  46. : or making a reference to a tagged union has to copy the tag.
  47. :     To work out the exact rules I think in terms of the implementation.
  48.  
  49. Okay, we're thinking on different levels.  From the programmer's point of 
  50. view it doesn't make any difference, but to the implementor it does.  In
  51. that case I vote for whatever makes the implementor's job easiest.
  52.  
  53. : I'll have a go soon, perhaps while on holidays. 
  54.  
  55. You mean you're not on holidays?  With all the well-thought-out posts you
  56. make in comp.lang.c++ I assumed you *were* on holidays!  I can't see how you
  57. could possibly have time otherwise!  Thanks, by the way, for your 
  58. contributions (though, since most of what you talk about is extending
  59. C++, the ANSI Extensions WG may feel otherwise :-) ).
  60.  
  61. : ;----------------------------------------------------------------------
  62. :         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  63. :     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  64. : ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
  65.  
  66. Shawn Willden
  67. swillden@icarus.weber.edu
  68.