Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!pikes!mercury.cair.du.edu!news From: ttoupin@zephyr.cair.du.edu (Aerin) Newsgroups: comp.lang.c++ Subject: Re: solution to implementing parameterized classes Message-ID: <1991Jun12.223310.6791@mercury.cair.du.edu> Date: 12 Jun 91 22:33:10 GMT References: <1991Jun9.204515.18040@ms.uky.edu> <1991Jun11.183133.11458@auto-trol.com> <1991Jun12.171947.28079@iitmax.iit.edu> Sender: news@mercury.cair.du.edu (netnews) Organization: University of Denver Lines: 69 In article <1991Jun12.171947.28079@iitmax.iit.edu> gkt@iitmax.iit.edu (George Thiruvathukal) writes: >In article <1991Jun11.183133.11458@auto-trol.com>, mattel@auto-trol.com (Matt Telles) writes: >> FINALLY! Someone else that dislikes the idea of a pointer to nothing ... >> Can't we define a type called generic???? (You know, like a generic pointer). >> Matt > >...or perhaps one could be allowed to declare variables of type void, given its >distinguished status as a "scalar" type :-). Then one can declare variables >which hold nothing and for which no space is allocated. I like the idea of a generic type (leads to: generic pointers), something like int xxx=3; type thing=xxx, *ptr=&xxx; Then `thing' acts as an type with value `3'. The `type' structure would hold a mangled name for the type it stores; maybe "i" for thing and "Pi" for ptr. A secondary mangled name would be allowed for casting, so that the object doe not loose its integrity after a cast (it still knows that it is a ... when it has been cast to a ...). It would be nice, then, to be able to do something like if(thing==) // something if thing holds an type else if(thing==) // something if thing holds ... THAT In addition, functions should come equipped with two variables, like `this': arguments - an argument list (type arglist) of what the function was called with retval - the return value So, one can do int myprintf(const char *p ...) { if(arguments==) // special case... Does something neat :) else printf(p ...); } Or, better yet: myprintf.arguments=<"%s",7.3,&xxx,"blah">; // do something here myprintf.call(); // calls myprintf with preloaded arguments... With preloaded arguments, one might specify arguments to a destructor, among other things. Well, that's my $0.02. Comments? >-- >George Thiruvathukal > >Laboratory for Parallel Computing and Languages >Illinois Institute of Technology >Chicago -- Tory S. Toupin | ttoupin@diana.cair.du.edu | Existence toward perfection... Unversity of Denver | Life of mediocrity! Undergraduate: Math & Computer Sciences| Denver, CO 80208 | - M. E. ----- Ceci n'est pas une signature.