[DGD] Invalid ranges...

Erwin Harte harte at xs4all.nl
Mon Oct 22 03:08:57 CEST 2001


On Sun, Oct 21, 2001 at 08:42:07PM +0200, Troels Therkelsen wrote:
> I'm probably missing something obvious, but I'm getting some
> inconsistencies in the .. operator that I don't understand.
> 
> int *a = ({ 1, 2, 3 });
> string b = "123";
> 
> Using DGD 1.2.32.
> 
> Then the following holds true:
> 
> case 1)
>   a[3..] == ({ })
>   b[3..] == ""
> 
> but...
> 
> case 2)
>   a[4..] == error
>   b[4..] == error
> 
> In my way of seeing things, either both cases or neither should fail.
> Preferably neither :-)
> 
> Bug or feature or am I just being daft?

Feature for as far as I can remember working with DGD.  It's the
degenerate case of splitting up an array by doing something like this:

  arr_beg = arr[.. i];
  arr_fin = arr[i + 1 ..];

Where i == sizeof(arr) gives your first case, same for strings.

Erwin.
-- 
Erwin Harte <harte at xs4all.nl>
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list