HDTenEightyP/NetNews huggingface dataset:
From: pete@borland.com (Pete Becker)
Subject: Re: Borland's design decisions
Organization: Borland International
Date: Fri, 10 Apr 1992 16:37:58 GMT

In article <1992Apr9.123716.1061@pictel.com> boba@pictel.com (Bob Alexander) writes:
>pete@borland.com (Pete Becker) writes:
>>>In the class libraries, they have a doubly-linked list object.  They have
>>>member functions that delete from either end of the list, but it seems
>>>there's no way to remove an item from the middle of the list.
>>>
>>	The function detach() will do what you want.
>
>You're right, but it's not quite what I had in mind.  detach() searches
>through the list from the beginning to find the object you want to
>remove: a potentially time consuming task.  Also, there's still no way
>to add to the middle of a doubly-linked list.
>
>What would be nice is an add and detach function that took an iterator as
>an argument and used it to insert or detach an object anywhere in the list.
>

	Well, I don't want to get off into the side issue of what iterators
ought to do, but my view of an interator is that it doesn't make sense to
modify a container while you're iterating through it.  Makes the semantics
of the iterator rather hard to describe.  I know there are others who don't
share this view...
	But more to the point, yes, a linked list probably ought to provide
things like insertAfter().  On the other hand, most folks shouldn't be
using linked lists at all.  They should be using an abstraction that fits
their problem space.  That abstraction has things like "give me the nth
element", "add this item after the nth element", etc.  That abstraction can
be implemented in many different ways.  Two that jump to mind are a linked list
and a vector.  But the decision on which to use depends intimately on the
runtime characteristics of the particular program, and that choice may have to
change as the program develops.  Hardcoding a linked list may create 
maintenance problems if it turns out that a vector would work better.  The
code should be written to use some sort of sequencing abstraction which can
be implemented transparently as a linked list, a vector, a trie, or whatever.
	All of which has very little to do with the original comment...
	-- Pete
From: sakkinen@jyu.fi (Markku Sakkinen)
Newsgroups: comp.lang.c++
Subject: Re: Call by reference using * and &
Date: 16 Apr 92 06:55:21 GMT
Organization: University of Jyvaskyla, Finland

In article <rmartin.703296361@willing> rmartin@willing.Rational.COM (Bob Martin) writes:
> ...
>Secondly, the forms:
>	
>	void f(TYPE*);
>	void f(TYPE&);
>
>are not semantically equivalent.  They both represent the
>pass-by-value paradigm, but the pointer form allows the argument to be
>zero, whereas the reference form does not.  The reference form
>*guarantees* that a real object is being refered to.
>
>Both forms are useful, but should be used at the appropriate times.
>When the pointer form is used, the called function should always
>assume that the argument can be zero.  When using the reference form,
>the called function should never check for zero.  

I don't think so.  Suppose you have the reference-based variant of 'f',
and then call it like this:
	TYPE *p = 0;
	// ...
	f(*p);
Are there any C++ systems that could trap this error so that 'f' does
no get invoked?

BTW, to be as similar to possible, the pointer-based alternative above
should be:
	void f (TYPE * const);

In principle, it is unfortunate that the language lacks straight old
call-by-reference.  Reference types (which are not first-class datatypes)
are a somewhat inconvenient work-around.

----------------------------------------------------------------------
Don't smell rotten -- avoid a "look and smell" litigation from
Apple Computer.

Markku Sakkinen (sakkinen@jytko.jyu.fi)
       SAKKINEN@FINJYU.bitnet (alternative network address)
Department of Computer Science and Information Systems
University of Jyvaskyla (a's with umlauts)
PL 35
SF-40351 Jyvaskyla (umlauts again)
Finland
----------------------------------------------------------------------
Newsgroups: comp.lang.c++
From: checker@acf3.nyu.edu (Christopher Hecker)
Subject: Re: Need more help, PLEASE, PLEASE, PLEASE!!!!
Organization: New York University
Date: Thu, 16 Apr 1992 22:33:11 GMT

>        virtual int operator<(const SortableObject&) = 0;
>        virtual int operator>(const SortableObject&) = 0;

>        virtual int operator<(const studentRecord & stdrec) {
>        virtual int operator>(const studentRecord & stdrec) {

The reason you are getting the errors is that you aren't overriding the
virtual functions, you are hiding them.  In order to override, you must
have the same arguments...notice above that you have the base functions
take SortableObjects and the derived take studentRecords.  So, your pure
virtual functions are still in the derived class, they simply aren't
visible.

Chris
From: jamshid@ut-emx.uucp (Jamshid Afshar)
Newsgroups: comp.lang.c++
Subject: Re: C++ Critique (1 of 4) (long)
Summary: God, Babel, diff. languages, TOWER unto heaven, Eiffel - coincidence?!
Keywords: religious, C++, criticism, Babel, babble
Date: 15 Apr 92 00:10:49 GMT
Reply-To: jamshid@emx.utexas.edu
Organization: The University of Texas at Austin; Austin, Texas

In article <1992Apr8.115131.16053@syacus.acus.oz.au> ian@syacus.acus.oz.au
(Ian Joyner) writes:
>Can grafting OO concepts onto a conventional language realise the full
>benefits of OO? Perhaps a biblical quote can be applied: "No one sews
>a patch of unshrunk cloth on to an old garment; if he does, the patch
>tears away from it, the new from the old, and leaves a bigger hole.
>No one puts new wine into old wineskins; if he does, the wine will
>burst the skins, and then wine and skins are both lost.  New wine goes
>into fresh skins." Mark 2:22

I've heard of people getting religious in arguments against C++, but
never so quite so literally.

:-) Sorry, I'll be more constructive in subsequent followups.

Jamshid Afshar
jamshid@emx.utexas.edu
From: acoles@bwdls59.bnr.ca (Andrew Coles)
Newsgroups: comp.lang.c++
Subject: Virtual function problem/warning
Date: 14 Apr 92 14:10:55 GMT
Reply-To: ACOLES@BNR.CA
Organization: BNR Woodline, Ottawa

When I compile my application, I get the following warning statement :  

   warning:  clCilDatasetsELW::NewSearchInformation() hides virtual 
      clEditableListWidget::NewSearchInformation()


Here's a bit of the code...


class clEditableListWidget : public clWindow
   {
   ..... ....
   public:
         virtual   void       NewSearchInformation (obj_idst proKey);
   ..... ....
   };

file clEditableListWidget.cpp
   {
   .... .....

      void   clEditableListWidget :: NewSearchInformation (pr_edst *info)
      {
         // For lint...
         if (info) {}
      }
   .... .....
   }





class clCilDatasetsELW : public clEditableListWidget
   {
   ..... ....
   public:
         void            NewSearchInformation (pr_edst *info);
   ..... ....
   };

file clCilDatasetsELW.cpp
   {
   .... .....
      void clCilDatasetsELW :: NewSearchInformation (pr_edst *info)
      {
         ..... ....
         ..... ....
      }
   .... .....
   }


I could be blind but I can't see a problem.  Can you?


ACOLES@BNR.CA
From: matt@askinc.ask.COM (Matthew Rabuzzi)
Newsgroups: comp.lang.c++
Subject: Re: question about class member access rules, A CLARIFICATION
Date: 7 Apr 92 22:50:36 GMT
Organization: ASK Computer Systems, Inc.

In response to <3 Apr 92 15:11:04 GMT, hira@walkman2.bellcore.com>,
I just wrote:

> Here is the general rule:
> A member function of any class
> has access to all members of objects of the same class

Whoops.  I was concentrating so hard on the rest of my explanation that
I screwed up the simplest part.  I meant:

A member function of any class
has access to 
    - members newly declared in the class,
    - public inherited members, and
    - protected inherited members
of objects of the same class
From: cyberman@toz.buffalo.ny.us (Cyberman)
Newsgroups: comp.lang.c++
Subject: Re: naming conventions for methods
Date: 16 Apr 92 23:50:35 GMT
Organization: The Tower of Zot - (716)838-0220

andrew@lsa.ncl.omron.co.jp (Andrew Walduck) writes:
> I'm looking for a means of naming methods according to what they do...
> does anyone out there have a "standard"??
>
>   constructors --  they construct (or create) an object
>   destructors  --  they destroy an object

C++ uses the name of the class defined as the constructor and destructor
IE
class simple {
        // constructor
        simple(void);
        ~simple(void);
        }
not sure what you mean by inspectors but those would be 
functions performed within the class ditto for modifiers.   Operators can 
be any legal ANSI C operator. [I wonder about user defined?  I 
wish this was supported]
Cyberman  
 


************************************************************
* Cyberman@TOZ.BUFFALO.NY.US                               *
*   "Life is what you put into it" - Cyberman              *
* Optimistic - running through a barn of manure looking    *
* for the horse!  /\ [] ( )                                *
Newsgroups: comp.lang.c++
From: bje@cs.brown.edu (William J. Etienne)
Subject: Re: OO Structured Design Question
Organization: Brown Computer Science Dept.
Date: Wed, 15 Apr 1992 19:11:45 GMT


Unfortunately, there doesn't seem to be a standard notation for object-oriented
design.  The Rumbaugh notation is a clear step in the right direction.  The 
book is easy to read and gives insight to the design process, as well as the 
notation.


-- William

________________________________________________________________________________
William Etienne                            "These thoughts are not mine!
bje@cs.brown.edu                            I don't know where they came from
uunet!brunix!bje                            and I'm not responsible for their
bje@browncs.bitnet                          content!" - Author Unknown
________________________________________________________________________________
From: sab@reef.cis.ufl.edu (Shawn Berg)
Newsgroups: comp.lang.c++
Subject: Thankyou
Date: 14 Apr 92 18:28:51 GMT
Followup-To: overloading += operator
Organization: Univ. of Florida CIS Dept.


I just wanted to thank to everyone that responded to my article about
overloading the += operator (i made a typo in the original post, it
said =+ instead); got plenty of information and successfully implemented
it.

Thanks again,
Shawn Berg

Newsgroups: comp.lang.c++
From: brianw@philips.oz.au (Brian Wallis)
Date: Fri, 10 Apr 92 04:49:20 GMT
Organization: Philips Public Telecommunications Systems, Melbourne, Australia
Subject: Gunnar Teege's Emacs C++ class browser

Does anyone know much about this?

I read somewhere that it should be ftp'able from ftp.informatik.tumuenchen.de
in the file /pub/GNU/emacs/contrib/c++browser91.tar.Z.

Unfortunatly I can't even find the machine!

Is this package available from somewhere else (preferably in Australia)

Thanks,

-- 
-----------------------------------------------------------------
Brian Wallis <brianw@philips.oz.au>	     Phone: +61 3 8813576
Philips Public Telecommunications Systems      Fax: +61 3 8813577
Melbourne, Australia
From: larsn@Autodesk.COM (Lars Nyman)
Newsgroups: comp.lang.c++
Subject: Ambiguity using multipli inheritance
Date: 14 Apr 92 03:19:36 GMT


class A {
public:
    virtual void foo() { bar(); }
    virtual void bar() { }
};

class B {
public:
    virtual void bar() { }
};

class C : public A, public B {
public:
};

/////////////////////////////

Now assume:
{
    C c;

    c.foo();
}

A::foo() calls bar(); bar() is a virtual function, and thus should invoke
C's bar().  But C inherits bar() from both A and B. Which bar() will be 
invoked ?

In my opinion, given C inherits from both B and A, A::foo's use of bar is
ambiguous.

ARM, Section 10.1.1, p 206:
"Ambiguos uses of derived class members are detected at compile time.  Only
 the USE of a name in an ambiguous way is an error, however; combining classes
 that contain members with the same name in an inheritance scheme is not an
 error".

Sun C++ (CFront 2.1) happily compiles the above, but does not issue an
error or warning - A::bar() will be invoked.
If you define a member of C that use bar() you get the ambiguity error
and have to explicitly resolve bar.  And then A::foo() will invoke C::bar().

So the question:  Is the USE of bar() in A::foo() a "use of a name in an
                  ambiguous way" and thus should be an error ?
Newsgroups: comp.lang.c++
From: sdm@cs.brown.edu (Scott Meyers)
Subject: Re: A really good way to do this is?
Organization: Brown University Department of Computer Science
Date: Wed, 8 Apr 1992 21:54:26 GMT

In article <DOUG.92Apr8102050@monet.ads.com> doug@monet.ads.com (Doug Morgan) writes:
| In article <1992Apr8.004446.3033@ncsu.edu> easchwei@eos.ncsu.edu (ERIC ARNOLD SCHWEITZ) writes:
|    ...
|    The problem at hand is I'd like to be able to define a general
|    class which I can inherit from that has a the following property:
|    each time a member function is called a hidden member function,
|    eg. an access function, is called and when the member function
|    exits a `deaccess' function is called.
|    ...
| 
| The easiest way to do this in C++ (under UNIX) is to make an exec of a
| CommonLISP process where you do the rest of your program using CLOS.
| Seriously though, forget it. 

Ah, now, it's not that bad, really it's not.  It's just that you have to do
it manually. For every member function f that you want to have a wrapper
for, you just declare a wrapper function wf that calls f.  Make wf public
and f private, and make wf nonvirtual in all cases; f may be virtual or
not, depending on its semantics.  I use a naming convention to indicate the
relationship between the two functions: if f is a wrapper function, then f_
is the corresponding wrapped function.  (I also have private members begin
with a leading underbar, so f really wraps _f_.  This is gross, I know, but
at least it looks pretty from the outside.)  Hence:

    class whatever {
    private:
      void _f_();
    public:
      void f() { /* before stuff */ _f_(); /* after stuff */ }
    };

If you want to do the same before stuff and after stuff for your entire
class, you can define a macro to declare both the function and the wrapper
at the same time.  Smart editors can also be programmed to insert the text
for you.

This isn't quite what is asked for, because it's not automatic, but it does
get the job done.  An earlier version of g++ supported wrapper functions in
the manner you desire, but I don't know if it still offers that language
extension.

Scott


-------------------------------------------------------------------------------
What do you say to a convicted felon in Providence?  "Hello, Mr. Mayor."
From: rmartin@willing.Rational.COM (Bob Martin)
Newsgroups: comp.lang.c++
Subject: Re: C++ as a 1st programming language ?
Date: 16 Apr 92 19:47:53 GMT
Article-I.D.: willing.rmartin.703453673

wilde@tigger.Colorado.EDU (Nick Wilde) writes:


>Greetings - How would you rate C++ as a language to 
>*teach* programming in, from the beginning ?

Daunting.  Such a project could easily convince students that software
is far too complex for them to deal with. 

C++ is a "big" language.  It has lots of very complex features.  I
would not suggest that you attempt to teach it as a "first" language
unless you want your students to run, screaming, out of the classroom.

>Also, can anyone recommend an "Intro to C++" book which does
>*not* assume a background in another programming language ?
>For instance, would the Booch book, that gets such glowing
>reviews in this forum, suffice ?

Booch is certainly not such a book.  It is specifically written for
the software professional who wants to learn Object Oriented Design.
Lippman's Primer is more suited for the novice.  However, even this
book is not a "First Principles of Programming" book.  

>My advisor finds himself in the position of teaching the "Intro
>to Programming" class for CS majors next semester. At this
>point, he's trying to decide what language to use to best get 
>across the concept of programming as a problem solving process,
>rather than getting hung up on the syntatical issues of any one
>language. 

C++ is a great language for "syntatical issues".  C or Pascal might be
a better language for beginners.  You might try to get away with using
just the C-ish parts of C++ too.  That would give you strong typing,
which is valuable in a teaching (and any other) environment.

>He's considering C++, without knowing a lot about it.  How would
>you, as a C++ guru, rate the language for a teaching a beginner
>to program in ? Does C++ hide some of the stickier syntactic
>foibles of C, or does all that come shining through ? (For
>instance, the infamous = and == confusion that every beginning
>C programmer falls prey to once upon a time).

Oh, they all come shining right through, along with a whole ream of
other interesting issues.  

This C++ 'guru' rate the language very very low for teaching to first
time students.  It would be like teaching algebra 101 by starting out
with Maxwell's equations.

IMHO


--
+---Robert C. Martin---+-RRR---CCC-M-----M-| R.C.M. Consulting         |
| rmartin@rational.com |-R--R-C----M-M-M-M-| C++/C/Unix Engineering    |
|     (Uncle Bob.)     |-RRR--C----M--M--M-| OOA/OOD/OOP Training      |
+----------------------+-R--R--CCC-M-----M-| Product Design & Devel.   |
From: emuleomo@yoko.rutgers.edu (Emuleomo)
Newsgroups: comp.lang.c++
Subject: Is this a FLAW in C++ ??
Keywords: C++ FLAW VIRTUAL VARIABLES
Date: 11 Apr 92 11:17:53 GMT
Article-I.D.: yoko.Apr.11.07.17.53.1992.9372
Organization: Rutgers Univ., New Brunswick, N.J.

Hi C++World,

I have been programming in C++ for quite some time now, and I love it!
I have since junked my C compiler!
However, I think there may be a FLAW in the language!
We have virtual functions, but not virtual *variables*. (Why Dr Stroustrup?)

For example.

I have 3 classes  FOO, BAR and OLU which perform identical operations
on a static array of that class. The array has different sizes,
depending on the class. The maximum size of the array is a static const 
variable and the next free slot in that array is pointed to by another static
variable! (I need a static array bcos all objects of these classes borrow 
stuff from the array!)
I foresee creating several other classes similar to FOO, BAR and OLU above!
What I would love to do is have a base class that knows how to
perform those operations on the derived class's static array and static 
variables .

My first approach is to cut-and-paste and do global change and replace!
However, this generates *too much code* and is error prone, not to mention
too tedious. (What if I decide to change that operation slightly? I would
have to propagate that change to each class!)

Now, if we had *virtual variables* I would simply create a base
class say MAGIC that had a non-virtual member function say manip()
that will manipulate the virtual static array and the virtual static
array index!!!

Thus foo.manip() would manipulate foo's static array whereas bar.manip()
would do the same operation on bar's static array!

Isn't this lovely??

If you have any thoughts on the matter, please E-mail to 
(emuleomo@yoko.rutgers.edu) OR oemuleom@doozer.shearson.com

--Cheers

--Olumide O. Emuleomo  (emuleomo@yoko.rutgers.edu)

NB: CLOS (the Common Lisp Object System) has before methods and After methods
(These are methods called BEFORE and AFTER the method you called is called!)
I really think C++ would benefit from these too!
-- 
Remember! It doesn't matter if you win or lose, as long as you win!
Xref: sparky comp.lang.c++:6565 comp.lang.c:7322
From: vorwald@oasys.dt.navy.mil (John Vorwald)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: NAN and INF numbers in C, C++
Date: 7 Apr 92 21:55:42 GMT
Reply-To: vorwald@oasys.dt.navy.mil (John Vorwald)
Followup-To: comp.lang.c++
Distribution: usa
Organization: Carderock Division, NSWC, Bethesda, MD


How do you initilize a varible to NAN (Not a Number) or INF (infinity) in
C or C++?  (I'm using Borland 3.0, but it shouldn't matter).

vorwald@oasys.dt.navy.mil
From: danderer@chopin.udel.edu (Dave Anderer)
Newsgroups: comp.lang.c++
Subject: BC30/Windows/Floating Point
Date: 8 Apr 92 17:49:27 GMT
Organization: University of Delaware


While testing an application against the Windows 3.1 final release
yesterday I stumbled on a problem I can't explain.  Note it's
*not* a 3.1 problem - it happens with 3.0, we just never noticed
it before.

Our program fails as follows:  Open one copy.  Leave it open, and
open a second copy.  Close the first copy.  Open a third copy -
well, try to, it'll UAE in the startup code.

Poking with the debugger seems to point the finger at the floating
point code - the program DOES use FP, and we compile it to use the
emulator.

To test this, we took one of the Borland sample apps (the WHELLO app,
in particular.)  Compile it as is, and it works fine.
Add a couple lines to it:

	float	f;
	f = 3.0 * f;

..and it blows up just like our application.  Which argues it's not
*our* problem.

Note that opening the third copy after 1) LEAVING the first copy
running, or b) closing BOTH the first and second copies works
fine.

Compiling to use the 80287 directly doesn't improve things.

We've also got an OWL app that exhibits the identical behavior.

Now we can grossly theorize what's going on here with DLLs, but
more importantly - how do we get around it?  ('Course, knowing WHY
it is this way would be nice, too.)
-- 
    Dave Anderer        danderer@brahms.udel.edu       (302) 831-8805
Instructional Technology Center, University of Delaware, Newark, De.  19716
		"Sinners can repent; stupid is forever."
From: ts@cup.portal.com (Tim W Smith)
Newsgroups: comp.lang.c++
Subject: Re: Borland or Microsoft?
Date: Sun, 12 Apr 92 08:57:05 PDT
Organization: The Portal System (TM)

> I want to learn c++ (I already know C) and therefore I would like
> some help with choosing the right books and a compiler.
> It seems to me that I can choose between the two big ones (B & MS).
> What are the anti and pro's?

Actually, you can put of choosing until *after* you learn C++!  There is
a book, "Learning C++," by Tom Swan, that was given a quite favorable
review in "C Gazette."

The interesting thing about this book is that it includes *everything*
except the computer and the operating system.  The disk included with the
book includes a version of the Zortech C++ compiler (claimed to be
compliant with AT&T 2.1), a shareware text editor, a linker, libraries,
and all the source code from the examples in the book.

I looked over the book briefly in a bookstore, and it mentions that the
compiler is a limited version of the full Zortech compiler.  It doesn't
seem to say how it is limited, though.

The price of the complete package was, if I recall correctly, about
the same as most other C++ books.  It looked like a pretty good deal.

							Tim Smith
From: howell@mwunix (Chuck Howell)
Newsgroups: comp.lang.c++
Subject: ISO: yacc grammar for C++, intermediate representation?
Date: 8 Apr 92 20:02:45 GMT
Organization: Mitre Corporation, McLean VA


I apologize if this is the 30th time this FAQ has been asked, but...
are there any public domain yacc grammars for C++?
Also, are there any "standard" or widely used intermediate
representations for C++ (e.g., for use in semantic analysis by tools
other than a compiler), or is it every vendor for themselves?

Thanks for any help,
    Chuck
+---------------------------------------------------------------------------+
|Chuck Howell, MS Z646                                                      |
|The MITRE Corporation         INTERNET: howell@mitre.org                   |
|7525 Colshire Drive                                                        |
|McLean VA 22102-3481          FAX: (703) 883-5519                          |
+---------------------------------------------------------------------------+
Newsgroups: comp.lang.c++
From: liu@matt.ksu.ksu.edu (Zu-Huan Liu)
Newsgroups: comp.lang.c++
Subject: Borland C++ 3.0 for sale
Date: 13 Apr 1992 13:45:48 -0500
Organization: Kansas State University
Distribution: world
NNTP-Posting-Host: matt.ksu.ksu.edu

Hi I have the whole package. Still not opened. Only one copy.
Only $100.00 or best offer.
