From 2b80d75aa298f490aedb8970b877f3edd7fd4bab Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 28 Mar 2015 00:15:04 +0100 Subject: fixes #2420; negative indexing for slicing is obsolete (breaking change!) --- web/news.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/news.txt b/web/news.txt index 3d60540ec..0b28c29bf 100644 --- a/web/news.txt +++ b/web/news.txt @@ -59,11 +59,12 @@ News echo x.T inc x - - **Negative indexing for slicing is deprecated and will be removed in the - next version of the language.** Instead of ``a[0.. -1]`` you can + - **Negative indexing for slicing does not work anymore!** Instead + of ``a[0.. -1]`` you can use ``a[0.. ^1]``. This also works with accessing a single element ``a[^1]``. Note that we cannot detect this reliably as it is determined at **runtime** whether negative indexing is used! + ``a[0.. -1]`` now produces the empty string/sequence. - The compiler now warns about code like ``foo +=1`` which uses inconsistent spacing around binary operators. Later versions of the language will parse these as unary operators instead so that ``echo $foo`` finally can do what -- cgit 1.4.1-2-gfad0