Topic: When is the C++ standard going to be completed?


Author: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Date: Fri, 23 Oct 1992 06:31:24 GMT
Raw View
In article <1992Oct21.160600.1600@taumet.com> steve@taumet.com (Steve Clamage) writes:
>cbusch@ub.d.umn.edu (Mmmm...) writes:
>
>>Also, will the new c++ standard have anything like 'with' like
>>pascal has?
>
>There is no proposal that I know of to add anything like the Pascal
>"with".  (I occasionally miss it, but I have also found it to be a
>source of confusion and subtle bugs when you happen to have a
>variable with the same name as a structure field.)
>--

 You already have it! And its much better than 'with'.
First, in members, there is an implicit 'with this'. When
you need a with explicitly use a reference:

 with a[i].s[j].salary ... base=100000.00;

becomes

 saltyp& sal=a[i].s[j].salary;
 sal.base=100000.00; // wish it were mine

and the extra word (sal) removes all the problems of Pascal 'with'
ambiguity. I wanted 'with' too until I discovered references.


--
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
 Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------




Author: warwick@cs.uq.oz.au (Warwick Allison)
Date: 27 Oct 92 04:48:37 GMT
Raw View
In <1c2nkpINN2sk@ub.d.umn.edu> cbusch@ub.d.umn.edu (Mmmm...) writes:

>Also, will the new c++ standard have anything like 'with' like
>pascal has?  I suppose OOP can somewhat get abused by such
>a command, but it could be very useful for typing shortcuts
>amoung other things...

... things like making code unreadable.  The trouble with WITH is that
to comprehend the identifiers in the WITH block, you must be familiar
with the record type that has been opened.  Far superior is the use
of references which reduce typing, but can stilled be followed.

For example,

        var a,b:integer;

 with foo[bar] do
   a:=b;

What is "a"?  What is "b"?  Maybe they are fields of foo[bar], maybe not.

But with:

 int a,b;

 int& fb=foo[bar];

 fb.a=b;

The secret is revealed that "a" is part of foo[bar], while "b" is the local.
All without knowing what type foo[bar] is.


Being from a Pascal and Modula-2 background, I have become familiar with
the uglinesses of those languages so-called "features".  [Over]use of nested
procedures is another scourge to the maintainer.


--
Warwick
--
  _-_|\      warwick@cs.uq.oz.au            /Disclaimer:
 /     * <-- Computer Science Department,  /
 \_.-._/     University of Queensland,    /   C references are NULL && void*
      v      Brisbane, Australia.        /




Author: sakkinen@jyu.fi (Markku Sakkinen)
Date: Thu, 29 Oct 1992 15:24:18 GMT
Raw View
In article <10803@uqcspe.cs.uq.oz.au> warwick@cs.uq.oz.au writes:
> ...
>But with:
>
> int a,b;
>
> int& fb=foo[bar];
        ^^^^ oops!
>
> fb.a=b;
>
>The secret is revealed that "a" is part of foo[bar], while "b" is the local.
>All without knowing what type foo[bar] is.
> ...

No, you certainly need to use exactly the type of foo[bar] to achieve
what you are trying above.  Thus:
 thing& fb = foo[bar];

----------------------------------------------------------------------
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
----------------------------------------------------------------------




Author: cbusch@ub.d.umn.edu (Mmmm...)
Date: 20 Oct 1992 23:51:37 -0500
Raw View
Hello
   When is the C++ standard going to be completed?  I realize
things like this take a long time but how long?

Also, will the new c++ standard have anything like 'with' like
pascal has?  I suppose OOP can somewhat get abused by such
a command, but it could be very useful for typing shortcuts
amoung other things...

-Chris Busch
(Someone who usually a day late and a $1 short :)





Author: steve@taumet.com (Steve Clamage)
Date: Wed, 21 Oct 1992 16:06:00 GMT
Raw View
cbusch@ub.d.umn.edu (Mmmm...) writes:

>   When is the C++ standard going to be completed?  I realize
>things like this take a long time but how long?

I estimate (unofficially) 2 years to a "draft standard", after
which it goes into the public comment and review cycle.  There
could be several cycles of about 6 months each before a final
standard is approved.

>Also, will the new c++ standard have anything like 'with' like
>pascal has?

There is no proposal that I know of to add anything like the Pascal
"with".  (I occasionally miss it, but I have also found it to be a
source of confusion and subtle bugs when you happen to have a
variable with the same name as a structure field.)
--

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16




Author: gjditchf@plg.uwaterloo.ca (Glen Ditchfield)
Date: Thu, 22 Oct 1992 14:18:16 GMT
Raw View
In article <1c2nkpINN2sk@ub.d.umn.edu> cbusch@ub.d.umn.edu (Mmmm...) writes:
>Will the new c++ standard have anything like 'with' like pascal has?

Reference variables are close enough for me.
    { int& it = foo.bar[baz]->gorf.wozzit;
      ...
      it += 9;
      }