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