mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 14:25:23 +00:00
implemented a[^1] notation
This commit is contained in:
19
web/news.txt
19
web/news.txt
@@ -42,6 +42,22 @@ News
|
||||
structure; for immediate macro parameters ``nkCall('addr', 'x')`` is
|
||||
produced instead of ``nkAddr('x')``.
|
||||
- ``concept`` is now a keyword and is used instead of ``generic``.
|
||||
- The ``inc``, ``dec``, ``+=``, ``-=`` builtins now produces OverflowError
|
||||
exceptions. This means code like the following:
|
||||
|
||||
.. code-block:: nim
|
||||
var x = low(T)
|
||||
while x <= high(T):
|
||||
echo x
|
||||
inc x
|
||||
|
||||
Needs to be replaced by something like this:
|
||||
|
||||
.. code-block:: nim
|
||||
var x = low(T).int
|
||||
while x <= high(T).int:
|
||||
echo x.T
|
||||
inc x
|
||||
|
||||
|
||||
Language Additions
|
||||
@@ -84,6 +100,9 @@ News
|
||||
varOrConst(x) # "var"
|
||||
varOrConst(45) # "const"
|
||||
|
||||
- Array and seq indexing can now use the builtin ``^`` operator to access
|
||||
things from backwards: ``a[^1]`` is like Python's ``a[-1]``.
|
||||
|
||||
|
||||
Library additions
|
||||
-----------------
|
||||
|
||||
Reference in New Issue
Block a user