home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:20032 comp.lang.c++:19702
- Path: sparky!uunet!spool.mu.edu!yale.edu!yale!mintaka.lcs.mit.edu!ai-lab!life.ai.mit.edu!tmb
- From: tmb@arolla.idiap.ch (Thomas M. Breuel)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: discriminated unions (Re: C/C++ Correctness (was: Re: C/C++ Speed))
- Date: 21 Jan 93 22:24:33
- Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
- Perceptive)
- Lines: 32
- Message-ID: <TMB.93Jan21222433@arolla.idiap.ch>
- References: <TMB.93Jan20160311@arolla.idiap.ch> <1993Jan20.184221.19003@netcom.com>
- <1993Jan21.004105.1335@ucc.su.OZ.AU> <1993Jan21.075642.6482@netcom.com>
- Reply-To: tmb@idiap.ch
- NNTP-Posting-Host: arolla.idiap.ch
- In-reply-to: erc@netcom.com's message of Thu, 21 Jan 1993 07:56:42 GMT
-
- >>>>> On Thu, 21 Jan 1993 07:56:42 GMT, erc@netcom.com (Eric Smith) said:
-
- > In article <1993Jan21.004105.1335@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
- >> Later I can write a breadth first search.
- >> I dont have to change anything to write the breadth first search.
- >> Its just a global function taking the tree as an argument.
- >
- > Ok, now I understand. You want to be able to add functionality to a class
- > without changing the class itself nor deriving a new version of it. Your
- > discriminated unions would be helpful toward that goal, but I still don't
- > see any overwhelming advantage of that goal. The only real advantage I can
- > see is that you don't have to use a new class name for your new version.
- >
- > Other than cluttering class name space, are there any disadvantages in
- > deriving new classes to add functionality?
-
- You can't add functionality to a class X by writing code for a class Y
- (derived from X). That is, your new BFS algorithm for objects of type
- Y (derived from X) won't work on objects of type X.
-
- Thomas.
-
-
-
-
-
-
-
-
-
-
-
-