Topic: It was in Algol60, but missing in STL


Author: Alex Vinokur <alexander.vinokur@telrad.co.il>
Date: 1999/03/15
Raw View
Hi,

In Algol60 language (40 years ago) it was possible
   to work with arrays with various boundaries.
For example,
        array [5 : 20] is {a[5], a[6], ..., a[20]}
        array [-7 : 3] is {a[-7], a[-6], ..., a[3]}

In C/C++ we can work only with arrays
        {a[0], a[1], ..., a[size - 1]}.

The STL vector class is also vector
        {v[0], v[1], ..., v[size - 1]}.
There is no array/vector class with various boundaries
(I would like to be mistaken, but it seems I am not mistaken).

I have designed me own ClassFlexibleVector with various boundaries.
But I would like to use standard classes.

I don't ask why arrays with various boundaries are missing in C/C++.
But why are they missing in STL?
It was in Algol60.

        Thanks in advance,
        Alex


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: Miniussi <miniussi@ilog.fr>
Date: 1999/03/15
Raw View
Alex Vinokur wrote:
>
> Hi,
>
> [...]
> I don't ask why arrays with various boundaries are missing in C/C++.
> But why are they missing in STL?
First, they are not in the STL, does not mean they are "missing".

> It was in Algol60.
So what ?

I mean, you can't just require to put something in the STL just because
it was in Algol 60 ?

Anyway, such a class can be developped as a wrapper, I don't think it
meets the requirement of the standard lib (explained in the "C++ PL"
3rd ed, chapter 16).

Alain
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: jcoffin@taeus.com (Jerry Coffin)
Date: 1999/03/16
Raw View
In article <7ciumk$ksk$1@nnrp1.dejanews.com>,
alexander.vinokur@telrad.co.il says...

[ ... ]

> I don't ask why arrays with various boundaries are missing in C/C++.
> But why are they missing in STL?

My guess is that it simply didn't occur to anybody as a particularly
useful enhancement.  If you want different bounds, it's trivial to
implement it in terms of a standard vector.

> It was in Algol60.

Algol 60 included a number of features that have more or less
disappeared from programming in general.

When Niklaus Wirth defined Pascal, he retained this feature, but by
the time he defined Oberon, it disappeared.  About the only reasonably
recent language that seems to retain it is Ada...
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]