[DGD] Invalid ranges...

Pär Winzell Zell at Skotos.NET
Mon Oct 22 03:26:06 CEST 2001


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


That's what I recall as the practical reason -- however, defending the 
design as consistent is a different matter. The argument that I make in 
favour of it is this:

   ({ 1, 2, 3 }) + ({ 4 }) -> ({ 1, 2, 3, 4 })
and
   ({ 1, 2, 3, 4 })[3 ..] ->({ 4 })


Therefore it makes sense that
   ({ 1, 2, 3 }) + ({ }) -> ({ 1, 2, 3 })
should have
   ({ 1, 2, 3 })[3 ..] -> ({ })


No such analogy could be made for [4 ..] and higher, so there -is- a 
logical difference between the two cases in the original mail.

Zell

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list