HDTenEightyP/NetNews huggingface dataset:
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Proposal - enhancement for switch statement.
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Mon, 16 Nov 1992 15:03:31 GMT

In article <1992Nov15.190830.11622@cssc-syd.tansu.com.au> pete@cssc-syd.tansu.com.au (Peter Alexander Merel) writes:
>Before I describe what occurred to me, yes folks I know that a switch is not
>as useful as a virtual function.

	Not so. Switches and virtual functions have entirely different
purposes. Switches are correctly used for selecting amoung a set of options,
virtuals perform an indeterminate operation (I actually mean 'late bound').


	The switch is the *correct* form to use to discriminate
from a finite set of possibilities which are known in advance.
Virtuals are used for completely unknown possibilities not known
until run-time.


	This is why type selection for heterogeneous aggregates
should use switches. :-)
>
>But what I'd like for a snippet I'm working on at the moment would be for
>switch to use operator== rather than relying on conversion to int, so that 
>I could use it to test cases on objects rather than building an industrial 
>strength if statement. 

	You can always write

	T x=expr;
	if(x==case1){..}
	else if(x==case1){ ..}
	...
	else { ..}

which is better structured than a switch anyhow. For switches I would
like

	switch (i) {
	case 1..10: ... break;
	case 20,25,30: ... break;

Pascal did the switch better.

>
>Any chance?
>

	Doubt it. How about case 1..10: ?? Any chance? Probably not.

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
From: srvishy@picasso.ocis.temple.edu (S. R. Viswanathan)
Newsgroups: comp.lang.c++
Subject: Help for creating icons below menu bar in BC++ ????
Date: 19 Nov 92 05:48:59 GMT
Organization: Temple University
X-Newsreader: Tin 1.1 PL5

Hi,

Does anyone know how to create multiple icons below the menu bar (like the
kind in Turbo C++ software) in Borland C++ 3.0 probably using the
Resource Workshop or even otherwise ? Positive pointers are welcome....

- Vishy

P.S: Pls send mail to me directly and not to the newsgroups. Thanx.


--
<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=->
Internet: srvishy@picasso.ocis.temple.edu  *  Never put off till tomorrow,
Bellnet:  (215) 787-1043                   *     What you can avoid 
	  (215) 735-3563                   *          ALL TOGETHER.....
<-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=->
From: macg9505@uxa.cso.uiuc.edu (Michael Alan Corn)
Newsgroups: comp.lang.c++
Subject: Help with nested class and constructor
Date: 19 Nov 92 15:02:17 GMT
Organization: University of Illinois at Urbana


I could use a little help on nested classes:
      I would like to include one of Borlands Array classes in another class,
in the private data section, but since the constructor requires an int to
initialize the class, I'm not sure how or where to give it the value:

class foo {
      private:
      Array myarray(10); ///this doesn't work, the compiler chokes


so I've tried this, which seems to work

class foo {
      private:
      void *myarray;

and then in the constructor for foo I do the following:

foo::foo()
{
Array temp(10);
myarray = &temp;

Fine, the compiler seems to like this, but now I can't figure out how to
access the member functions of the object I store in myarray.  I use the Array
function ptrAt to get a pointer to the object:

myarray->ptrAt(index) and then, since ptrAt returns a Object * I do the
following to get at that objects member function
myarray->ptrAt(index)->memfunc();  This doesn't work.  The compiler complains
about every "->"; I assume that this is a precedence problem, but I really
don't know.  Any help would be greatly appreciated.  Thanks
macg9505@uxa.cso.uiuc.edu
Newsgroups: comp.lang.c++
From: kanze@us-es.sel.de (James Kanze)
Subject: Re: Overload operator to concatenate Strings?
Organization: SEL
Date: 18 Nov 92 12:46:14

In article <1992Nov13.111415.1@happy.colorado.edu>, Jim Adcock writes:

|> In article <1992Nov13.111415.1@happy.colorado.edu>
|> srheintze@happy.colorado.edu writes:

|> |I have considered using operator|| but Plum and Saks discourage it for reasons
|> |I don't completely understand.  It is intuitive to old PL/I programmers to use
|> |operator|| for character string concantenation. It seems logical to be
|> |consistent with something that already exists rather than invent some new
|> |notation.  

|> If your target audience is old PL/I programmers, then use the ||
|> notation.

|> If your target audience is C++ programmers, then use + since that is
|> the most common operator chosen to mean string cat in the C++ world.
|> If you're writing an overloaded I/O operator use << and >> like
|> iostreams -- these choices don't have to make much sense -- they've
|> become established by convention.  If you try to rethunk them now,
|> you'll just be making your work gratuitously incompatible.  Then
|> again, why not get an existing class library with an existing string
|> class?  Why keep reinventing the [square] wheel?

An additional reason governing the choice of operators is the
precedence.  While I sort of like '&' for concatenation, it has the
wrong precedence for my tastes.  a & b == c is a & (b == c) (illegal).

For that matter, '&' and '|' also have the wrong precedence for bit
operators.  For this reason, in my SetOf classes, I not only overload
them (since they are what I would expect for intersection and union),
but also '*' and '+', less natural, but the right precedence.
--
James Kanze			GABI Software, Sarl.
email: kanze@us-es.sel.de	8 rue du Faisan
				67000 Strasbourg
				France

Newsgroups: comp.lang.c++
From: pete@cssc-syd.tansu.com.au (Peter Alexander Merel)
Subject: Re: Proposal - enhancement for switch statement.
Organization: AOTC - CSSC
Date: Thu, 19 Nov 1992 21:10:40 GMT

maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>
>[the lecture on switch vs. virtuals I'd hoped to avoid]
>
>[an example of an if statement ... gee, thanks :-)]
>
>Pascal did the switch better.

I can't agree with this completely. I like being able to fall through 
through cases; it's a clumsy way to do disjunction, I admit, but it's
got an explicit order dependence that you don't get any other way. I
don't use that much (ever?) but I like knowing it's out there, somewhere.

>	Doubt it. How about case 1..10: ?? Any chance? Probably not.

Certainly not. The advantage I'm trying to get is to be able to use
a switch on types that don't go onto int. You can already use such
types in conditional expressions inside whiles, ifs and fors, by 
virtue of operator==. I just don't see why switch should be left out in
the cold like this; I suspect it's a bit of polymorphism envy from Bjarne.

-- 
Internet: pete@cssc-syd.tansu.com.au   UUCP: {uunet,mcvax}!munnari!cssc-syd!pete
Snail: 1/18-20 Orion Road, Lane Cove NSW 2066 Australia    Phone: +61 2 911 3130
I am a big pond in a small fish.
Newsgroups: comp.lang.c++
From: pete@borland.com (Pete Becker)
Subject: Re: Diagnostic Message Class?
Originator: pete@genghis.borland.com
Organization: Borland International
Date: Mon, 16 Nov 1992 21:39:16 GMT

In article <92321.094912SASTPH@vm.sas.com> SASTPH@vm.sas.com writes:
>Some weeks ago a C++ journal containing an article on how to construct
>a diagnostic message class crossed my desk.  I skimmed the article and
>passed the journal on.
>

	It was The C++ Report, would have been the August issue or so...
	-- Pete


Newsgroups: comp.lang.c++
From: mat@mole-end.matawan.nj.us
Subject: Re: comp.lang.c++
Organization: :
Date: Tue, 17 Nov 1992 06:44:45 GMT

In article <1992Nov13.193122.8662@dorsai.com>, head@dorsai.com (Howard Pinsley) writes:

> rog@hpscit.sc.hp.com (Roger Haaheim) writes:
> : In comp.lang.c++, maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:

> : > 	It might be appropriate to have a comp.newuser.c++
> :                                           ^^^^^^^^^^^^^^^^
> Why split it up?  If newuser-type questions go in a different conference, they
> might not get the benefit of replies from more experienced c++ programmers who
> might avoid such a conference.  Let's stay together.

As much as I want to encourage and help new people, I also need a newsgroup
where I can bounce harder questions off people.  Discussing a subtelty of
overload resolution isn't in the same league as telling someone to put
an  extern "C" int f();  in his program.

At the very least, I would like to see `environment' stuff (how to compile,
how to link) off in a seperate newsgroup.  And a RTFF (`Read the Funky FAQ')
newsgroup wouldn't hurt (excepting the pain of the people sent there).

The character of this newsgroup has changed dramatically over the past 18
months.  Something's gained, but something's lost, too.
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
Subject: Re: Member function renaming proposal from the ARM
Reply-To: nikki@trmphrst.demon.co.uk
Distribution: world
X-Mailer: cppnews $Revision: 1.20 $
Organization: Trumphurst Ltd.
Date: Thu, 19 Nov 1992 12:28:16 +0000

In article <1992Nov17.031938.10774@fcom.cc.utah.edu> swillden@news.ccutah.edu (Shawn Willden) writes:
[My suggestion for extending the "virtual function =" syntax omitted.
> The standard trick of defining Derived::set(int) and Derived::set(double)
> as inline forwarding functions should work without any run-time penalty
> if the compiler is smart.  All it has to do is recognize what is happening
> and put the addresses of the Base methods in the Derived vtable.  Given
> that this is such an easy optimization I don't think we need a language
> extension for it (and another bit of syntax to learn).
Has anyone ever seen a compiler which does this ? 
Why not ? Is it too hard, or are compiler writers just lazy ?

-- 
Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
Newsgroups: comp.lang.c++
From: qwerty@gina.dei.unipd.it (Luigi Scappin 264462/IL)
Subject: OODatabase Library
Keywords: for BC++ 
Organization: D.E.I. Universita' di Padova -- Italia
Date: Tue, 17 Nov 1992 10:18:13 GMT


I know that Zortech C++ gots some libraries that allow building a OO Database.
(I think they simply save classes and objects)
My question is: Is this possible with Borland C++?
Thanks in advance for any help.

		Scappin Luigi

	qwerty@paola.dei.unipd.it
	qwerty@sabrina.dei.unipd.it


Newsgroups: comp.lang.c++
From: john@bnrmtl.bnr.ca (John Hickin)
Subject:  sizeof( data member )
Reply-To: bnrmtl!john@larry.mcrcim.mcgill.edu
Organization: Bell Northern Research Montreal, Canada.
Date: Wed, 18 Nov 92 17:12:07 GMT

My compiler won't let me code like this:

    class Foo
    {
            char Data[ 200 ];
    public:
        static void foo( int );
        ...etc.
    };

    void Foo :: foo( int needed )
    {
        if ( !(needed <= sizeof(Foo::Data)) ) complain();
    }

Of course I can use the enum { Size = 200 } to work around the problem.
The question is, should the langauge allow you to take the size of a
data member without having an object in hand?

-- 
John Hickin      Bell-Northern Research, Montreal, Quebec
(514) 765-8888   bnrmtl!john@larry.mcrcim.mcgill.edu
From: matt@physics16.berkeley.edu (Matt Austern)
Newsgroups: comp.lang.c++
Subject: Re: The fate of my exponentiation operator proposal
Date: 17 Nov 92 13:24:03
Organization: Lawrence Berkeley Laboratory (Theoretical Physics Group)
Reply-To: matt@physics.berkeley.edu
NNTP-Posting-Host: physics16.berkeley.edu
In-reply-to: sakkinen@jyu.fi's message of Tue, 17 Nov 1992 10:43:05 GMT

In article <1992Nov17.104305.24116@jyu.fi> sakkinen@jyu.fi (Markku Sakkinen) writes:

> >I am sorry to see this proposal rejected because I still believe that,
> >of the currently popular languages, C++ is probably the best suited
> >for the type of scientific programs that I write.  The absence of an
> >exponentiation operator, however, will make it harder for me to
> >persuade my colleagues to that point of view."
> 
> One more reason for you to evaluate the other language alternatives
> in earnest, I suggest.  Perhaps your colleagues have even other grounds
> than pure stubbornness to favour some other languages.  

Perhaps.  Certainly one intelligent reason is that it is foolish and
expensive to either abandon or rewrite large bodies of existing and
working code.  I imagine that I'll still be doing some of my
programming in Fortran for many years to come.

For new programs that are being written today, though, I do not
believe that Fortran is the best language for scientific programming.
I believe that object-oriented programming is a genuine advance on
previous methods, and I believe that while it is possible to achieve
some of its benefits using a non-object-oriented language (e.g., C,
Ada, or yes, even Fortran), this involves discipline on the part of
the programmer that is hard to maintain over the scope of a large
project, and that the resulting program is likely to be more poorly
structured and less clear than a program written in a language
designed with object-oriented programming in mind.

So I am certainly willing to look at other languages than C++; it's
foolish to become emotionally attached to any particular programming
language.  At this point, however, I would prefer to look at languages
which were designed for object-oriented programming.  And, obviously,
I would also prefer languages which are widely available on a variety
of platforms, and which have reasonably efficient implementations.
These requirements narrow the field quite a bit.

(Despite the subject line of this post, of course, this has almost
nothing to do with an exponentiation operator.  That really is a minor
issue compared to the question of whether or not to use an
object-oriented language.)
--
Matthew Austern                   Just keep yelling until you attract a
(510) 644-2618                    crowd, then a constituency, a movement, a
austern@lbl.bitnet                faction, an army!  If you don't have any
matt@physics.berkeley.edu         solutions, become a part of the problem!
Newsgroups: comp.lang.c++
From: sailer@hpuerca.atl.hp.com (Lee Sailer)
Subject: Re: Criticisms Wanted
Date: Fri, 20 Nov 1992 00:14:02 GMT
Organization: Hewlett-Packard NARC Atlanta
X-Newsreader: Tin 1.1.3 PL5

Paul Potts (potts@oit.itd.umich.edu) wrote:
: In article <1992Nov13.060823.1358@BofA.com> dan@BofA.com (Dan Brockman) writes:
: >In article <1992Nov11.175117.15325@bcrka451.bnr.ca> sjm@bcrki65.bnr.ca (Stuart MacMartin) writes:
: >>
: >Reading source code is hardly a crime.  He could be trying to fix the damned
: >bug his benighted colleague wrote into the program.  He could be trying to 
: >find the damned bug.  
: 
: If I could get by without doing it, I would certainly prefer it. The
: programmers that wrote some of the classes I'm using might have been
: making a lot of money, but they sure don't know how to write readable
: code. The biggest reasons seem to be:
: 
)

I like reading the source.  But good documentation is very handy, too.

perhaps a good compromise is "literate programming".  In LP, the documentation
and the code are the same thing.  As implemented by web, filters exist
which convert the well-documented code to user readable documentation.  Other
filters convert the same code into stuff the compiler can use.

lee

Newsgroups: comp.lang.c++,comp.std.c++
From: pjl@cs.uiuc.edu (Paul Lucas)
Subject: Re: "Invalid" argument(s) in template class declaration, how to realize?
Keywords: template, argument
Organization: University of Illinois at Urbana-Champaign
Date: Fri, 20 Nov 1992 16:56:47 GMT

In <BxznCM.K9o@math.uwaterloo.ca> xjzhu@math.uwaterloo.ca (Xiaojun Zhu) writes:

>Q: When designing a template class, how to make sure that its argument
>   can only be certain classes or certain predefined types?

*****>	You can't.  When instantiation takes place, the user will get
	an error message that something is inappropriate.  If your class
	is documented, this shouldn't be a real problem, i.e., the user
	has to RTFM on your class.

>How do we provide such a mechanism?

*****>	IMHO, there's nothing wrong with the way it's done now.

>P.S. While I am writing this down, I feel this is probably a hard question,
>  because, I think, the template of C++ doesn't provide such property?
>(Well, just guess, don't get offended if it actually does.)  How hard
>will be a work around? 

*****>	If you insist, perhaps #pragma's and/or #error's to sugar-coat
	the error messages.
-- 
	- Paul J. Lucas				University of Illinois	
	  AT&T Bell Laboratories		at Urbana-Champaign
	  Naperville, IL			pjl@cs.uiuc.edu
Newsgroups: comp.lang.c++,comp.sys.mac.programmer
From: ferdie@coyote.datalog.com (fred jarvis)
Subject: Is anyone using MacApp for serious development?
Organization: Datalog Consulting, Tucson, AZ
Date: Thu, 19 Nov 92 05:55:12 GMT

   Is anyone using MacApp for serious development?

   My employer is developing MS Windows applications
(currently in C) and wants to convert one of our programs
to the Mac.  My preference is MacApp so I can develop
in C++.  However, browsing through a copy of "Develop,
The Apple Technical Journal" (Issue 10),  I see nary a word
about MacApp or OOP.  Do true Mac gurus not use MacApp?
   Incidentally, the app to be converted is a fairly heavy
duty scientific app, with lots of graphics, & pushes Windows
a little.

Fred Jarvis     ferdie@coyote.datalog.com
Newsgroups: comp.lang.c++
From: deanp@peg.pegasus.oz.au
Newsgroups: comp.lang.c++
Date: 17 Nov 92 23:59 EST
Subject: Re: MPW C++ bug?
Nf-ID: #R:BxKz81.8C5@vcd.hp.com:1656016945:peg:497700004:000:384
Nf-From: peg.pegasus.oz.au!deanp    Nov 17 23:59:00 1992


re: MPW linker stripping unused methods in general, particularly the
constructors.  Have you tried a) using the CPlus option (via Commando interface
if you don't have the documentation...) for not stripping unused code? or...
b) the MacApp macro DontDeadStrip(your thing)... ?  just some thoughts as I have
not actually had this problem... the above have worked fine for me

dean :)
From: ldup@ta7s49.alcbel.be (Luc Duponcheel)
Newsgroups: comp.lang.c++
Subject: ]Re : self reproducing C++ program
Date: 18 Nov 92 09:29:11 GMT
Organization: Alcatel Bell Telephone, Antwerpen, Belgium

Cristian,

>[question about the smallest self-reproducing C++ program deleted]


I also know the 'speedup theorem' of recursive function theory. It
tells us that any program can be optimised (with respect to some
complexity measure).

I never asked to produce a smallest self-reproducing C++ program.
I only asked if someone can find a smaller than mine. 

BTW: I know one which is smaller.

Luc.

Xref: sparky comp.lang.c++:16818 comp.unix.aix:11869
From: cmc@mind.ORG (Christopher M. Camacho)
Newsgroups: comp.lang.c++,comp.unix.aix
Subject: Re: g++ on AIX 3.2?
Date: Mon, 23 Nov 92 20:11:54 -0500
Organization: Fortress Development HQ

jeff@kuhub.cc.ukans.edu (Jeff Bangert) writes:
> Does g++ run OK under AIX 3.2?
> 
 runs great! you'll need to get a system update from IBM first,
though. the g++ package contains a file named README.RS6000 which
will help you along with exactly which APARs you need. just call
software support and ask for the specified fixes.

> Thanks for the help,
> 
 no problem -- enjoy!   :)

> -- 
> Jeff Bangert			jeff@kuhub.cc.ukans.edu
> Computer Center			jeff@ukanvax.bitnet
> University of Kansas
> Lawrence, KS 66045
> (913)864-0466

-chris
Newsgroups: comp.lang.c++
From: burchard@horizon.math.utah.edu (Paul Burchard)
Subject: Re: Multiple Inheritance - Necessary?
Organization: University of Minnesota
Date: Mon, 23 Nov 1992 07:34:00 GMT

> In <By17An.4uH@usenet.ucs.indiana.edu> ezachris@iroquois.ucs.indiana.edu  
writes:
> >A friend of mine who programs in Objective-C argues that multiple  
> >inheritance is unnecessary and complicated. 
> >
> >My Objective-C friend would make a new object "Pencil-with-eraser" that  
> >would declare two objects inside it.
> >
> >     PENCIL-WITH-ERASER
> >        Eraser TheEraser(...);
> >        Pencil ThePencil(...);
> >
> >I think this sounds like hogwash. What do you think?

You're both wrong :-).  It should be a subclass of pencil which has-a
eraser.

In article <1ejjcaINN1m5@armory.centerline.com> matt@centerline.com (Matt Landau) writes:
> 
> There are other uses of MI for which composition just doesn't provide
> the right kind of abstraction.  Consider a class "Collection" that lets
> you insert, remove, and search for elements.  Objects that are part of
> a collection must have certain attributes that comprise "collectability";
> in C++ these attributes are often expressed as virtual member functions
> used by the Collection class itself when manipulating members of the
> collection.  

Organizing "can-do" properties of classes is most appropriately done through
formal message protocols rather than inheritance (even the looser "forest"
model of inheritance).  Of course this requires dynamic binding.

Only if the common functionality has significant common code does it make
sense to use multiple inheritance to *implement* the protocol.

--
--------------------------------------------------------------------
Paul Burchard	<burchard@geom.umn.edu>
``I'm still learning how to count backwards from infinity...''
--------------------------------------------------------------------
[Disclaimer: I much prefer Objective-C over C++, because I find dynamic
binding a much bigger win than MI...and because Obj-C is just plain fun!]
From: ark@alice.att.com (Andrew Koenig)
Newsgroups: comp.lang.c++
Subject: Re: Andrew Koenig's C++ Class Lib.
Keywords: c++ library
Date: 19 Nov 92 13:36:36 GMT
Article-I.D.: alice.24239
Reply-To: ark@alice.UUCP ()
Organization: AT&T Bell Laboratories, Murray Hill NJ

In article <1992Nov18.194017.5344@erg.sri.com> dhsong@camel.erg.sri.com (Song Dong-ho) writes:

> Does anyone out there know any ftp site for Andrew Koenig's C++ class
> library which implemented most of Smalltalk Classes ?

Sorry to disappoint you, but there's no such beast.
Perhaps you're confusing me with Keith Gorlen?
-- 
				--Andrew Koenig
				  ark@europa.att.com
Newsgroups: comp.lang.c++