Hi,
Do we need subrange types?
Martin
--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and
We may use them as base types to use directly (with exact or default
ranges) or to spawn exact types (globally) so that people used to the
exact types to feel themselves in known environment.
--
November Webinars for C, C+
On Friday 08 November 2013 08:11:15 Ivanko B wrote:
> We may use them as base types to use directly (with exact or default
> ranges) or to spawn exact types (globally) so that people used to the
> exact types to feel themselves in known environment.
>
No other use? Do you use Pascal subrange type?
Do you use Pascal subrange type? Would you miss it?
=
Me use one in other languages - in BASH :
-
for i in `seq 1 10`; do
echo $i
done
-
for instance.
in SQL :
[..] where i between 1 and 10
--
PL/PgSQL
-
BTW, shortcuts for range check might be very handy :
---
if i in 1..10 then
---
or
---
if i between 1 and 10 then
---
less cumbersome than
-
if (i >= 1) and (i <=10) than
-
---
On Friday 08 November 2013 08:54:38 Ivanko B wrote:
> Do you use Pascal subrange type? Would you miss it?
> =
>
> Me use one in other languages - in BASH :
> -
> for i in `seq 1 10`; do
> echo $i
> done
> -
> for instance.
>
> in SQL :
>
On Friday 08 November 2013 09:00:12 Ivanko B wrote:
> BTW, shortcuts for range check might be very handy :
>
> ---
> if i in 1..10 then
> ---
>
> or
>
> ---
> if i between 1 and 10 then
> ---
>
> less cumbersome than
>
> -
> if (i >= 1) and (i <=10) than
> Hi,
> Do we need subrange types?
>
i personally never used them , since using native types would do the job as well
--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable pro
/lib/common/i18n/mseucs2ru.pas :
---
const
cp866_2: array[$2550..$256C] of byte = (
$cd,$ba,$d5,$d6,$c9,$b8,$b7,$bb,$d4,$d3,$c8,$be,$bd,$bc,$c6,
$c7,$cc,$b5,$b6,$b9,$d1,$d2,$cb,$cf,$d0,$ca,$d8,$d7,$ce
);
cpUCS2_1: array[$b5..$be] of longword = (
$2561,$256
if rangeok(i,1,10) then begin
===
as a compiler proc (to serve an operator/operation) - OK.
--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programmi
On Friday 08 November 2013 09:49:41 Ivanko B wrote:
> /lib/common/i18n/mseucs2ru.pas :
> ---
> const
>
> cp866_2: array[$2550..$256C] of byte = (
> $cd,$ba,$d5,$d6,$c9,$b8,$b7,$bb,$d4,$d3,$c8,$be,$bd,$bc,$c6,
> $c7,$cc,$b5,$b6,$b9,$d1,$d2,$cb,$cf,$d0,$ca,$d8,$d7
On 11/08/2013 07:00 AM, Martin Schreiber wrote:
> Do we need subrange types?
I understand subranges are only useful for defining arrays with same as
index.
But as you want to disallow "whatever based" arrays, I doubt
array[TSubrange] makes much sense.
In fact a subrange is a special case of an
Hmm, arbitrary array beginning presents one of specific Pascal
features sometimes very handy for expressing entities if the real
world. It's usually well optimized (acccess via base register,..).
While accessing may be emulated by index shift but it's definetely an
workaround.
in fact a subrange is a special case of an enumerated Type
=
Or of the SET type thus needs a (shortcut) operator for range checking :)
--
November Webinars for C, C++, Fortran Developers
Accelerate applicat
may be emulated by index shift but it's definetely an workaround.
==
And calculating this shift on each access eats some CPU ticks :)
--
November Webinars for C, C++, Fortran Developers
Accelera
A strange "idea" :) Why not to combine ranged ingtegers, enums & sets
in a single type ?
--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
tech
Hallo Ivanko,
Du schriebst am Fri, 8 Nov 2013 13:00:12 +0500:
> BTW, shortcuts for range check might be very handy :
Use sets.
> ---
> if i in 1..10 then
> ---
if i in [1..10] then ...
Do the brackets bother you?
BTW, yes, that applies only to ranges accomodated by set variab
Hallo Martin,
Du schriebst am Fri, 8 Nov 2013 10:03:49 +0100:
> Arbitrary array indices probably will be removed. Wiki:
> "
> 14. Item index of strings and arrays is zero-based.
Well - design decision.
> 15. No arrays of arbitrary range,
Incomplete language implementation.
> type
>
Hallo Ivanko,
Du schriebst am Fri, 8 Nov 2013 14:54:47 +0500:
> A strange "idea" :) Why not to combine ranged ingtegers, enums & sets
> in a single type ?
Doesn't work. At least sets are different beasts.
--
--
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet,
Hallo Ivanko,
Du schriebst am Fri, 8 Nov 2013 14:47:45 +0500:
> Hmm, arbitrary array beginning presents one of specific Pascal
Not so - they're older, probabely dating back to PL/I. The Algols (Algol 60
& 68) also had them. (Algol is a short form for "Algorithmic language".)
--
--
(Weitergabe
Hallo Michael,
Du schriebst am Fri, 08 Nov 2013 10:40:11 +0100:
> On 11/08/2013 07:00 AM, Martin Schreiber wrote:
> > Do we need subrange types?
I'd opt for them.
> I understand subranges are only useful for defining arrays with same as
> index.
TYPE
MonthDay = 1..31;
WeekDay = 1..7;
C
On Friday 08 November 2013 23:17:40 Sieghard wrote:
>
> > 15. No arrays of arbitrary range,
>
> Incomplete language implementation.
Why? We don't talk about Pascal. I often see errors in programs because of
wrong 0/1 array starting index. Oberon doesn't have it either:
"
6.2. Array types
An arr
Hallo Martin,
Du schriebst am Fri, 8 Nov 2013 07:00:21 +0100:
> Do we need subrange types?
Positively, but they are required to have (compile time, at least) range
checking.
--
--
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung od
Hallo Martin,
Du schriebst am Sat, 9 Nov 2013 07:41:13 +0100:
> Why? We don't talk about Pascal. I often see errors in programs because
> of wrong 0/1 array starting index. Oberon doesn't have it either:
That's due to the early C exposures people suffer these times.
You require theater seat numb
On Saturday 09 November 2013 20:57:24 Sieghard wrote:
>
> There's no performance gain, there's just no performance _difference_
> between 0-based and arbitrary-based arrays - and there's no need of a "base
> register" of any kind. Just have the compiler shift the (imaginary) base
> address of the a
You require theater seat numbers to start at 0 for each row as well?
Sine we'll have bit counts etc starting from 0 then it's more
consistent to count everything numeric from 0 as well :)
--
November W
Just have the compiler shift the (imaginary) base address
=
It may break connections with numbering in real-world task. What for
to do it if keeping this connection doesn't slow down performance ?
--
November Webin
On 11/11/2013 05:35 AM, Ivanko B wrote:
> You require theater seat numbers to start at 0 for each row as well?
+1
(If the count of seats is > 9 it would start with "00", of course.)
> Sine we'll have bit counts etc starting from 0 then it's more
> consistent to count everything numeric from 0 as w
On 11/08/2013 11:26 PM, Sieghard wrote:
>
> TYPE
>MonthDay = 1..31;
>WeekDay = 1..7;
>CharBits = 5..9; { for serial interfaces }
>
> Not useful?
IMHO Only really useful if you go on
Type WorkingHours = Array [MonthDay] of Integer;
or similar.
-Michael
---
Hallo Michael,
Du schriebst am Mon, 11 Nov 2013 09:56:02 +0100:
> On 11/11/2013 05:35 AM, Ivanko B wrote:
> > You require theater seat numbers to start at 0 for each row as well?
> +1
>
> (If the count of seats is > 9 it would start with "00", of course.)
Okay - you get seat number 00. Go to th
Hallo Michael,
Du schriebst am Mon, 11 Nov 2013 10:00:17 +0100:
> On 11/08/2013 11:26 PM, Sieghard wrote:
> >
> > TYPE
> >MonthDay = 1..31;
> >WeekDay = 1..7;
> >CharBits = 5..9; { for serial interfaces }
> >
> > Not useful?
>
> IMHO Only really useful if you go on
>
> Type Workin
Hallo Ivanko,
Du schriebst am Mon, 11 Nov 2013 11:37:24 +0500:
> Just have the compiler shift the (imaginary) base address
> =
> It may break connections with numbering in real-world task. What for
> to do it if keeping this connection doesn't slow down performance ?
Oh, you count the bi
32 matches
Mail list logo