HDTenEightyP/NetNews huggingface dataset:
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: "type safety" deemed essential
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Tue, 22 Dec 1992 00:00:32 GMT

In article <448@genie.UUCP> roger@genie.UUCP (Roger H. Scott) writes:
>In article <rmartin.724430168@thor> rmartin@thor.Rational.COM (Bob Martin) writes:

>>For any significant industrial application, I think strong typing is
>>utterly essential.  It is just too easy to create horrible run time
>>errors without type safety.  
>
>This sounds like theory rather than practice speaking.  Let's hear from the
>(net) C++ user community: who has written a non-trivial commercial C++ 
>application *without* making significant use of either type casting [(T *)]
>or run-time type checking [Bar *bar_p = foo_p->asBar();]?  

	I have. I hardly EVER use casts. I have used discriminated
unions for heterogeneity, and this idiom is indeed insecure,
which is why I'm working on a proposal to fix this.

>I maintain that
>C++ makes it *very* difficult to do without at least one or the other of these
>(Eiffel-style "anchored" virtual function return types would go a long way to
>alleviate this).  

	On the contrary, this would open a gaping hole in the type system.
They also only apply to special (though common) cases where multiple
dispatch is required. Then you have to choose between safety and
extensibility, you cant have both (the run-time checks ar required)

>I'm hoping that templates will help in this regard, but they
>haven't been available long enough to judge.

	Its next to impossible to write generic container classes
without using templates or casting. So use templates.

	It is sometimes necessary to do dynamic downcasting,
but such uses are usually not required in ordinary programs.

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Newsgroups: comp.lang.c++
From: c0365384@techst02.technion.ac.il (Esteban D. Schnir)
Subject: Re: Gnu C++ - what did I miss?
Organization: Technion, Israel Institute of Technology
Date: Fri, 1 Jan 1993 22:07:32 GMT

Were can I get it ?

-- 
Esteban D. Schnir                             c0365384@TechSt02.Technion.Ac.Il
Department of Computer Engineering                 bs778@Cleveland.Freenet.Edu 
Technion - Israel Institute of Technology                eschnir@Nyx.Cs.Du.Edu 
Tel.:+(972)-(4)-294538                                   Fax:+(972)-(4)-223854
Newsgroups: comp.lang.c++
From: ericm@ims.com (Eric Martinson)
Subject: Borlands next C++ release?
Originator: ericm@hummer
Organization: Integrated Measurement Systems, Inc.
Date: Wed, 30 Dec 1992 15:47:58 GMT

I saw an add for Turbo Pascal with Objects on the back cover of a magazine.
I personally could care less about Pascal Object Oriented Programming (POOP)
but I was interested in the claim of a DPMI extender included with the package.
Has anyone heard if Borland International plans on including such an extension
with the next release of Borland C++? Any rumors and/or suggested availability
dates?

Happy New Year
-- 
==========================================================================
Eric C. Martinson                           Integrated Measurement Systems
ericm@ims.com|(503) 626-7117	    A Subsidiary of Cadence Design Systems
==========================================================================
Newsgroups: comp.lang.c++
From: wc8519@writer.yorku.ca (Colin Beckmann)
Subject: Graphics in C C++
Organization: Computer Assisted Writing Centre, York University, Toronto, Canada
Date: Thu, 24 Dec 1992 19:01:14 GMT

	I am trying to learn a little about GUI in C-C++ and have been 
reading  two books by James McCord  "C Programmers Guide to Graphics" and
"Borland C++ Programmers Guide to Graphics"  The first does not go into 
mice in any form but the second provides a model of a graphical user 
interface.  I thought  this is **GREAT**. :-). One problem, "it don't
work,Ma" and I, being a mere lowly apprentice don't know how to fix it. :-( 
Perhaps someone out there can help me with this problem.I am using Borlands
3.1 and source code settings are for C++ since I am using BGI graphics .
Your help is greatly appreciated.  Replys can either go to the net or email 
me directly.  The solution is probably quite simple and I am going to 
look like the rank amature that I am by if you never ask you'll never know.
Thanks in advance. 


The offending code seems to be

		/* This function is used to communicate with the mouse 	*/
		/* via interrrupt 0x33h												*/

void mouse_call (regax, regbx, regcx, regdx)
{
	union REGS inregs, outregs ;

	inregs.x.ax = regax ;
	inregs.x.bx = regbx ;
	inregs.x.cx = regcx ;
	inregs.x.dx = regdx ;

	int86 (0x33, &inregs, &outregs) ;

	globax = outregs.x.ax ;
	globbx = outregs.x.bx ;
	globcx = outregs.x.cx ;
	globdx = outregs.x.dx ;
}

which was ment to work with 


void get_demo_option (void)
{
	do
	{
		mouse_call (5,0,0,0) ;
		update_pos () ;
	}	while (globbx == 0) ;

	bar (1,21,638,445) ;
	if (globcx >= 20 && globcx <= 180 && globdx >= 20 && globdx <= 39)
	{
		putimage (100,100, dialog_box, COPY_PUT) ;
		monitor_dialog () ;
	}

	if (globcx >= 20 && globcx <= 180 && globdx >= 40 && globdx <= 59)
	{
		putimage (100,100, scroll_bar, COPY_PUT) ;
		monitor_scroll () ;
	}

	if (globcx >= 20 && globcx <= 180 && globdx >= 60 && globdx <= 79)
	{
		putimage (100,100, radio_button, COPY_PUT) ;
		monitor_radio () ;
	}

	if (globcx >= 20 && globcx <= 180 && globdx >= 80 && globdx <= 99)
	{
		draw_tool () ;
	}

	if (globcx >= 20 && globcx <= 180 && globdx >= 100 && globdx <= 120)
	{
		clear_screen () ;
	}
}

This was to activate part of a pull down menu.
I know that the old style function def for mouse_call was obsolete and and
the program would not run.  I changed it to 

void mouse_call (int regax, int regbx, int regcx, int regdx)

and the program would compile but the clicking the button does not do
much.  The program displays the x y coordinates of the mouse and the mouse
is where they say it is.  The program was apparently written for Borland
2.0 
Any help would be appreciated.
Happy Holidays

Colin

email  wc8519@grant.yorku.ca

 
Newsgroups: comp.lang.c++
From: markham@brtph597.bnr.ca (Andrew Markham P205)
Subject: Help with floating point I/O (well, really O)
Organization: BNR Inc. RTP, NC
Date: Tue, 22 Dec 1992 20:04:20 GMT

The following C++ code:

        #include <iostream.h>
        #include <iomanip.h>
        
        main()
        {
            float a = 0.1, b=0.12, c=0.123, d=0.0;
        
            cout << setprecision(3) << setw(6) << a << endl;
            cout << setprecision(3) << setw(6) << b << endl;
            cout << setprecision(3) << setw(6) << c << endl;
            cout << setprecision(3) << setw(6) << d << endl;
        }

Prints the following output:

        > a.out
           0.1
          0.12
         0.123
             0
        >

How do I get it to print the following?

        > a.out
         0.100
         0.120
         0.123
         0.000
        >

Thanks.

-- 
Andrew W. Markham (markham@bnr.ca)
Bell Northern Research, Inc.
From: dom@oasis.icl.co.uk (dominic alston)
Newsgroups: comp.lang.c++
Subject: Re: Survey: File Extension
Date: 22 Dec 92 15:48:13 GMT
X-Newsreader: Tin 1.1 PL3

maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>In article <WARSAW.92Dec12174801@anthem.nlm.nih.gov> warsaw@nlm.nih.gov (Barry A. Warsaw) writes:
>>
>>More important is consistancy within your project and compilers/tools
>>ought to be configurable to use just about any extension: .cc .cxx
>>.cpp .C whatever...
>
>Maybe, more important is to eventually have a proper module system
>independent of the file system.
>
	This thread is starting to get ADA like. . 

--
Dominic Alston                                 "Where am I ?.. In the village."
International Computers Ltd.               
Lovelace Road.                              dom@oasis.icl.co.uk ||
Bracknell RG12 4SN                          ..!uunet!mcvax!ukc!iclbra!dom ||
Berks, England.                             da16@unix.brighton.ac.uk

Tel: +44 344 424842 x2324
Fax: +44 344 487832

Disclaimer: class MyDisclaimer : public StdDisclaimer {
				public: MyDisclaimer():StdDisclaimer() { }
			}
From: keith@msmri.med.ubc.ca (Keith S. Cover)
Newsgroups: comp.lang.c++
Subject: WANTED: heap manager software
Date: 26 Dec 1992 06:29:27 GMT
Organization: University of British Columbia, Vancouver, B.C., Canada
Distribution: world
NNTP-Posting-Host: msmri.med.ubc.ca

Can anyone give me a pointer to C++ code which will overload new and delete
to improve my heap management.  The vast majority of the new's in my program 
allocate 24 to 32 bytes at a time.  I would prefer a manager which is 
efficient in both time and memory since I am having problems with both
execution time and limited memory.

I will post a summary of the replies.

Thanks in advance.

Keith S Cover
Physics, UBC
Newsgroups: comp.lang.c++
From: mwb@ulysses.att.com (Michael W. Balk)
Subject: Re: BORLAND C++ ; new int(1,000,000)
Summary: 64k data limit per module in huge model
Date: Thu, 31 Dec 1992 18:51:28 GMT
Organization: AT&T Bell Laboratories, Murray Hill

In article <C01upJ.FAx@fig.citib.com>, ghica@fig.citib.com (Renato Ghica) writes:
> 
> Is it possible to allocate more than 640K (from extended or
> expanded memory) on a DOS 5.0 system using a borland 3.1 C++ program?
> 
> Using the huge memory model, I'm trying to do the equivalent
> of 
> 	new int(1,000,000);  
> 
> 	without commas, of course.
> I have not successed. (I know I can allocate 64k+ at the time).
> 

According to the Borland 3.1 C++ Programmer's Guide, even though the
total static data for the huge model can exceed 64k, it must be less
than 64k within *each* model.  Given that statement, I don't see
how new int(1000000) could ever work.

		Mike Balk
		AT&T Bell Laboratories
		Murray Hill, NJ 07974
		mwb@ulysses.att.com



Newsgroups: comp.lang.c++
From: amdavi@cs.wm.edu (Alexander M. Davis)
Subject: Introductory text
Organization: The College of William and Mary
Date: Mon, 28 Dec 1992 15:06:54 GMT

Could someone reccomend a good text for both elementary C and C++? I have
had instruction in Pascal, but nothing like C, and need knowledge of C++
for courses.

Alex Davis
amdavi@cs.wm.edu

Newsgroups: comp.lang.c++
From: cflatter@nrao.edu (Chris Flatters)
Subject: Re: template disappointments ... (suggesti
Reply-To: cflatter@nrao.edu
Organization: NRAO
Date: Wed, 30 Dec 1992 16:51:54 GMT

In article 92Dec29191250@gomez.stanford.edu, mcgrant@gomez.stanford.edu (Michael C. Grant) writes:
>
>In article <1992Dec29.204431.13413@nrao.edu>
>cflatter@nrao.edu (Chris Flatters) writes:
>   In article 92Dec29133556@muse.cv.nrao.edu,
>   dschieb@muse.cv.nrao.edu (Darrell Schiebel) writes:
>   >	(1) The inability to derive templated classes from a non-templated 
>   >	    base class of the same name:
>   >		class typeinfo {};
>   >		template<class t> class typeinfo : public typeinfo {};
>Yeah, that's a bummer. I see no reason why typeinfo and typeinfo<T>
>can't be distinguished by any reasonable compiler.

I can.

The declaration of a class introduces a new keyword into the language.  After
encountering the declaration "class typeinfo { ... };" the lexical analyser will
recognize "typeinfo" as a class name.  This means that "template<class T>
class typeinfo: public typeinfo {};" looks like:

1) a second definition of typeinfo; and

2) a definition of a class that inherits from itself.

In principle it is possible to envision a template name space that is separate
from the class name space but this would require the decision of whether an
identifier is a class name or a template name to be made with some awareness
of the context in which it appears.  This would rule out the use of LR(k)
parsers (such as those generated by yacc) since syntactic elements are not
recognized until all of their components have been scanned.  This is a fairly
hefty price to pay.

>
>   This is according to the ARM:
>
>           A class template name must be unique in the program and may not
>           be declared to refer to any other template, class, function,
>           object, value, or type in the same scope.
>                                                           [p343]
>What's yer point? That's why this is called 'template disappointments.'

The point is that cfront will reject "template <class T> class foo: public foo {}"
because it is forbidden by the language definition and not because of a compiler
deficiency.

	Chris Flatters
	cflatter@nrao.edu
From: ark@alice.att.com (Andrew Koenig)
Newsgroups: comp.lang.c++
Subject: Re: IS C++ a language for the "average programmer"
Date: 28 Dec 92 16:29:41 GMT
Article-I.D.: alice.24498
Reply-To: ark@alice.UUCP ()
Organization: AT&T Bell Laboratories, Murray Hill NJ

In article <1992Dec28.052523.15305@nuscc.nus.sg> tim@iss.nus.sg (Tim Poston) writes:

> Extensions, yes,... with added assumptions.
> Calculus requires the operation `take the limit',
> which is not a part of basic arithmetic.

Well...not really.

If you construct the real numbers axiomatically,
you will find that there is only one property that
is necessary to distinguish them from the rationals,
and that is precisely the property that defines limits.

Now, you might argue that computers implement integers
but don't truly imnplement reals -- but indeed they don't
truly implement integers either.
-- 
				--Andrew Koenig
				  ark@europa.att.com
Newsgroups: comp.lang.c++
From: a7657@mindlink.bc.ca (Stephen H. Kawamoto)
Subject: X-Windows graphics
Organization: MIND LINK! - British Columbia, Canada
Date: Fri, 25 Dec 1992 18:42:25 GMT

Image Alchemy (Version 1.6) is neat in that it can read as well as write
X-Window graphics files (color) with suffix .XPM.

The thing is, .XPM files are C code with #DEFINEs for format, width, height,
number of colors,characters per pixel, a static character array for
substitution of 6byte hex field with 2-byte character field, and the encoded
picture field (also array, of pixels).

Is there any code to write to a standard VGA screen using the EGA/VGA mode
numbers?

As well, does anyone with X-Windows want to have a few small 320x200x256
samples to try out?

Email would be convenient.

--
Stephen Kawamoto <a7657@mindlink.bc.ca>
    "It is the very mind itself
     That leads the mind astray;
     Of the mind,
     Do not be mindless."
     (an old Japanese folk song)
Newsgroups: comp.lang.c++
From: mcgrant@rascals.stanford.edu (Michael C. Grant)
Subject: Re: template disappointments ... (suggesti
Organization: Information Systems Laboratory, Stanford University
Date: 30 Dec 92 10:29:14

In article <1992Dec30.165154.25081@nrao.edu>
cflatter@nrao.edu (Chris Flatters) writes:

   The declaration of a class introduces a new keyword into the language.  After
   encountering the declaration "class typeinfo { ... };" the lexical analyser will
   recognize "typeinfo" as a class name.  This means that "template<class T>
   class typeinfo: public typeinfo {};" looks like:

I see the difficulty.

   >
   >   This is according to the ARM:
   >
   >           A class template name must be unique in the program and may not
   >           be declared to refer to any other template, class, function,
   >           object, value, or type in the same scope.
   >                                                           [p343]
   >What's yer point? That's why this is called 'template disappointments.'

   The point is that cfront will reject "template <class T> class foo: public foo {}"
   because it is forbidden by the language definition and not because of a compiler
   deficiency.

Again, I ask 'what's yer point?' We're describing things that we know darn
well aren't permitted for one reason or another, BOTH because it is
forbidden and because the compiler is deficient.

Mike

--
"Long hair, short hair--what's the difference once the head's blowed off?" (?)
Newsgroups: comp.lang.c++
From: cflatter@nrao.edu (Chris Flatters)
Subject: Re: template disappointments ... (suggesti
Reply-To: cflatter@nrao.edu
Organization: NRAO
Date: Wed, 30 Dec 1992 16:11:36 GMT

In article 1hqnd6INNe83@agate.berkeley.edu, jbuck@foucault.berkeley.edu (Joe Buck) writes:
>In article <24508@alice.att.com> ark@alice.UUCP () writes:
>>In article <DSCHIEB.92Dec29133556@muse.cv.nrao.edu> dschieb@muse.cv.nrao.edu (Darrell Schiebel) writes:
>>> 		list<vector<int>> list_vec_int;
>>
>>Huh?? This works fine -- just remember to put a space between the
>>two > characters so the >> won't be taken for a shift-right symbol.
>
>This is such a common error (and is so ugly) that compiler writers
>would be well advised to add productions to their grammar that catch
>it, or magic that splits the >> token into two tokens in this case
>if that fits in with the compiler's structure.
>
>Yes, I know that the rules of lexical analysis force the >> to be one
>token, but list<vector<int>> is a perfectly natural way of writing
>this thing, so perhaps it should be permitted even at the cost of
>adding an ugly rule to the grammar.

It requires more than a modification to the grammar (unless you find it
acceptable to allow arbitrary amounts of whitespace in the middle of
a right-shift operator).  You would have to switch lexical analysers
while parsing a template declaration or a template class name and switch
back afterwards.

	Chris Flatters
	cflatter@nrao.edu
Newsgroups: comp.lang.c++
From: jimad@microsoft.com (Jim Adcock)
Subject: Re: feedback wanted on appropriate OOPL
Date: 28 Dec 92 17:36:20 GMT
Organization: Microsoft Corporation

In article <92358.192930COP80196@UCF1VM.BITNET> Bill Laird <COP80196@UCF1VM.BITNET> writes:
|For the author's need, C++ was the appropriate choice. But here is
|where I would like some feedback. I know that many C++
|programmers have Smalltalk experience, so I want to find out
|which language you think would be the most beneficial to students.
|Keep in mind that many of the students probably won't know
|anything about OOP, and that in addition to learning a new language,
|all of the methodology of OOP needs to be learned. Also consider that
|all of the students have used C in the past, and the temptation to make
|C act like C++ may be a problem to some.

Three points from my perspective:

1) I have known many OO programmers coming from a Smalltalk background
into C++.  I found them very difficult to work with, because they aways
tend towards trying to use a Smalltalk approach to C++, and C++ is not
Smalltalk, nor vice versa.  Good programming technique is not the same
between the two languages.

2) Having just done an interview with a interview candidate who has
an MS in CS, who claimed C/C++ as a primary language, but who couldn't 
program simple problems in a straight-forward manner, using style
appropriate for the C/C++ languages, I must again express frustration
at CS departments who don't teach students the skills they need to
get a job.  C is the mainstream programming language for the software
industry.  C++ is the mainstream OO programming language for the
software industry.  Non-mainstream languages are fine for PhD candidates
who plan to remain in acedemia.

3) Neither 1) nor 2) above is as important as having students who 
know and can perform the necessary applied mathematics.

Newsgroups: comp.lang.c++
From: mwette@csi.jpl.nasa.gov (Matt Wette)
Subject: why `int X: :X()' ?
Originator: mwette@mr-ed
Organization: Jet Propulsion Laboratory
Date: Wed, 30 Dec 1992 17:25:37 GMT


I'm starting to really get into some C++ programming and was wondering
about the following:

Why are constructor and destructor functions usually declared to return
ints when the usage typically warrents a `void' declaration.

Is this a requirement or just a convention?

Matt
-- 
mwette@csi.jpl.nasa.gov
Newsgroups: comp.lang.c++
From: trrgre03@uctvax.uct.ac.za
Newsgroups: comp.lang.c++
Subject: fstream problem
Date: 27 Dec 92 16:13:19 GMT
Article-I.D.: uctvax.1992Dec27.141319.203428
Organization: University of Cape Town

Can some one please help me?

I have been trying for a few days to get a program to work. It reads a dBase
'dbf' file, to get out the underlying structure. For some reason, though, it
refuses to read the character that terminates the field descriptions (an
ASCII 13 (hex 0D)). It just seems to skip over it like it isn't there. What
am I doing wrong? Any suggestions?

I'm using Turbo C++ 3.0, and the ifstream class.

This is a simplified version of the program:

ifstream testfile ("c:\\dbftest.dbf", ios::binary||ios::nocreate);
char c = 0;

while (  (!testfile.eof())  &&  (c != 13)  )
{
   testfile.get (c);
   cout << c;
}

I've tried various ifstream member functions, including:

     int get()
     istream& get (signed char&)
     int peek()
     istream& read (signed char*, int);

None of these seem to work, though. When stepping through the loop with the
debugger, they never return an ASCII 13.

Can anyone help. Please Email any responses.
Newsgroups: comp.lang.c++
From: tim@iss.nus.sg (Tim Poston)
Subject: Re: IS C++ a language for the "average programmer"
Organization: Institute of Systems Science, NUS, Singapore
X-Newsreader: Tin 1.1 PL4
Date: Mon, 28 Dec 1992 05:25:23 GMT

val@news.ccutah.edu (Val Kartchner) writes:

: The simple mathematical operations that we take for granted are simply
: derivations of the 13 assumptions.  Algebra is an extension of those.
: Calculus and geometry are an extensions of algebra.

Extensions, yes,... with added assumptions.
Calculus requires the operation `take the limit',
which is not a part of basic arithmetic.
It is a non-finitary operation, unlike plus and minus,
multiply and divided, and is therefore not implemented
in any computer architecture.  To do calculus on a machine
you must (a) approximate by small steps or (b) set up a
symbolic manipulation program like Mathematica,
which can finitely manipulate [some] _formulae_
to produce the _formulae_ for their derivatives,
integrals, etc.  Sometimes, though, nobody and no
program can find a formula for the answer,
and we go back to numerical approximation.

This is quite different from the relation of OOP to other methods.
It is possible to translate a C++ program to C,
and that is what Cfront does.
It is not possible to translate the fundamental theorem of calculus
(that integrating the derivative of f gives you back `total change in f')
into a statement in algebra, unless you restrict to a simple class
of functions---say, polynomials---where you can give algebraic formulae
for `derivative' and `integral'.

Big difference!

Tim

_________________________________________________________________________
              My lucky number is irrational.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Newsgroups: comp.lang.c++
From: pauljo@microsoft.com (Paul Johns)
Subject: Re: How to call C++ functions in a C program?
Date: 23 Dec 92 20:52:58 GMT
Organization: Microsoft Corp.

You can't include iostream.h in a C program.  And you should link
with the C++ runtime library, not the C runtime library.  I have
no idea how to specify this under UNIX.
Newsgroups: comp.lang.c++
From: jimad@microsoft.com (Jim Adcock)
Subject: Call to Order
Date: 23 Dec 92 20:58:43 GMT
Organization: Microsoft Corporation

Can we all *try* to do better at keeping postings on topic and constructive?

Please consider pondering the following questions before posting here:

1) Does your posting pertain generally to the C++ programming language
and/or programming community?

2) Does your posting make a positive contribution to the community of
C++ programmers who try to read these postings?

My concern is that we seem to be straying off-track, both away from
C++, and also towards negative postings.

Thanks.