<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.1">
</HEAD>
<BODY>
You also could if array[5 .. -3] implied length -3.<BR>
<BR>
Similarly. array[-3] could imply array[array.length -3]...<BR>
<BR>
But someone suggested against that, atleast for non-compile time checking. I would agree, for the non-literal instance that a negative integer of -5 shouldn't result in magical figuring out if the element needs to be pulled from the front or the back. But the literal case adds expressiveness, I think.<BR>
<BR>
Cheers,<BR>
Scott S. McCoy<BR>
<BR>
On Sun, 2008-03-30 at 22:54 +0200, Simen Kjaeraas wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">On Sun, 30 Mar 2008 22:43:11 +0200, Walter Bright </FONT>
<FONT COLOR="#000000"><<A HREF="mailto:newshound1@digitalmars.com">newshound1@digitalmars.com</A>> wrote:</FONT>
<FONT COLOR="#000000">> Scott S. McCoy wrote:</FONT>
<FONT COLOR="#000000">>> array[5..] and array[..5] seem to make perfect sense to me and get rid </FONT>
<FONT COLOR="#000000">>> of kludge like $.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> If $ were implicit, you couldn't do things like:</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">>         array[5 .. $-3]</FONT>
<FONT COLOR="#000000">You could if it were only optional.</FONT>
<FONT COLOR="#000000">--Simen</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>