Many improvements to 0.15.0 changelog in news article.

This commit is contained in:
Dominik Picheta 2016-09-28 21:36:06 +02:00
commit 6953c2e691

View file

@ -10,17 +10,16 @@ Some text here.
Changes affecting backwards compatibility Changes affecting backwards compatibility
----------------------------------------- -----------------------------------------
- The ``json`` module uses an ``OrderedTable`` rather than a ``Table`` - The ``json`` module now uses an ``OrderedTable`` rather than a ``Table``
for JSON objects. for JSON objects.
- De-deprecated ``re.nim`` because we have too much code using it - The ``split`` `(doc) <http://nim-lang.org/docs/strutils.html#split,string,set[char],int>`_
and it got the basic API right. procedure in the ``strutils`` module (with a delimiter of type
``set[char]``) no longer strips and splits characters out of the target string
- ``split`` with ``set[char]`` as a delimiter in ``strutils.nim``
no longer strips and splits characters out of the target string
by the entire set of characters. Instead, it now behaves in a by the entire set of characters. Instead, it now behaves in a
similar fashion to ``split`` with ``string`` and ``char`` similar fashion to ``split`` with ``string`` and ``char``
delimiters. Use ``splitWhitespace`` to get the old behaviour. delimiters. Use ``splitWhitespace`` to get the old behaviour.
- The command invocation syntax will soon apply to open brackets - The command invocation syntax will soon apply to open brackets
and curlies too. This means that code like ``a [i]`` will be and curlies too. This means that code like ``a [i]`` will be
interpreted as ``a([i])`` and not as ``a[i]`` anymore. Likewise interpreted as ``a([i])`` and not as ``a[i]`` anymore. Likewise
@ -29,80 +28,114 @@ Changes affecting backwards compatibility
Warning: a [b] will be parsed as command syntax; spacing is deprecated Warning: a [b] will be parsed as command syntax; spacing is deprecated
See `<https://github.com/nim-lang/Nim/issues/3898>`_ for the relevant See `Issue #3898 <https://github.com/nim-lang/Nim/issues/3898>`_ for the
discussion. relevant discussion.
- Overloading the special operators ``.``, ``.()``, ``.=``, ``()`` now - Overloading the special operators ``.``, ``.()``, ``.=``, ``()`` now
should be enabled via ``{.experimental.}``. needs to be enabled via the ``{.experimental.}`` pragma.
- ``immediate`` templates and macros are now deprecated. - ``immediate`` templates and macros are now deprecated.
Instead use ``untyped`` parameters. Use ``untyped`` `(doc) <http://nim-lang.org/docs/manual.html#templates-typed-vs-untyped-parameters>`_
- The metatype ``expr`` is deprecated. Use ``untyped`` instead. parameters instead.
- The metatype ``stmt`` is deprecated. Use ``typed`` instead.
- The metatype ``expr`` is deprecated. Use ``untyped``
`(doc) <http://nim-lang.org/docs/manual.html#templates-typed-vs-untyped-parameters>`_ instead.
- The metatype ``stmt`` is deprecated. Use ``typed``
`(doc) <http://nim-lang.org/docs/manual.html#templates-typed-vs-untyped-parameters>`_ instead.
- The compiler is now more picky when it comes to ``tuple`` types. The - The compiler is now more picky when it comes to ``tuple`` types. The
following code used to compile, now it's rejected: following code used to compile, now it's rejected:
.. code-block:: nim .. code-block:: nim
import tables import tables
var rocketaims = initOrderedTable[string, Table[tuple[k: int8, v: int8], int64] ]() var rocketaims = initOrderedTable[string, Table[tuple[k: int8, v: int8], int64]]()
rocketaims["hi"] = {(-1.int8, 0.int8): 0.int64}.toTable() rocketaims["hi"] = {(-1.int8, 0.int8): 0.int64}.toTable()
Instead be consistent in your tuple usage and use tuple names for tuples Instead be consistent in your tuple usage and use tuple names for named tuples:
that have tuple name:
.. code-block:: nim .. code-block:: nim
import tables import tables
var rocketaims = initOrderedTable[string, Table[tuple[k: int8, v: int8], int64] ]() var rocketaims = initOrderedTable[string, Table[tuple[k: int8, v: int8], int64]]()
rocketaims["hi"] = {(k: -1.int8, v: 0.int8): 0.int64}.toTable() rocketaims["hi"] = {(k: -1.int8, v: 0.int8): 0.int64}.toTable()
- Now when you compile console application for Windows, console output - Now when you compile console applications for Windows, console output
encoding is automatically set to UTF-8. encoding is automatically set to UTF-8.
- Unhandled exceptions in JavaScript are now thrown regardless ``noUnhandledHandler`` - Unhandled exceptions in JavaScript are now thrown regardless of whether
is defined. But now they do their best to provide a readable stack trace. ``noUnhandledHandler`` is defined. But the stack traces should be much more
readable now.
- In JavaScript ``system.alert`` is deprecated. Use ``dom.alert`` instead. - In JavaScript, the ``system.alert`` procedure has been deprecated.
Use ``dom.alert`` instead.
- ``AsyncHttpClient.headers`` type is now ``HttpHeaders``. - De-deprecated ``re.nim`` because there is too much code using it
and it got the basic API right.
- The ``httpclient.request`` procedure that takes the ``httpMethod`` as a string - The type of ``headers`` field in the ``AsyncHttpClient`` type
value no longer requires this value to be prefixed with ``"http"`` `(doc) <http://nim-lang.org/docs/httpclient.html#AsyncHttpClient>`_
has been changed
from a string table to the specialised ``HttpHeaders`` type.
- The ``httpclient.request``
`(doc) <http://nim-lang.org/docs/httpclient.html#request,AsyncHttpClient,string,string,string>`_
procedure which takes the ``httpMethod`` as a string
value no longer requires it to be prefixed with ``"http"``
(or similar). (or similar).
- Converting a ``HttpMethod`` value to string using the ``$`` operator will - Converting a ``HttpMethod``
`(doc) <nim-lang.org/docs/httpcore.html#HttpMethod>`_
value to a string using the ``$`` operator will
give string values without the ``"Http"`` prefix now. give string values without the ``"Http"`` prefix now.
- The ``Request`` object defined in the ``asynchttpserver`` module now uses - The ``Request``
`(doc) <http://nim-lang.org/docs/asynchttpserver.html#Request>`_
object defined in the ``asynchttpserver`` module now uses
the ``HttpMethod`` type for the request method. the ``HttpMethod`` type for the request method.
Library Additions Library Additions
----------------- -----------------
- Added ``readHeaderRow`` and ``rowEntry`` to ``parsecsv.nim`` to provide - Added ``readHeaderRow`` and ``rowEntry`` to the ``parsecsv``
`(doc) <http://nim-lang.org/docs/parsecsv.html>`_ module
to provide
a lightweight alternative to python's ``csv.DictReader``. a lightweight alternative to python's ``csv.DictReader``.
- Added ``setStdIoUnbuffered`` proc to ``system.nim`` to enable unbuffered I/O.
- Added ``center`` and ``rsplit`` to ``strutils.nim`` to - Added ``setStdIoUnbuffered`` proc to the ``system`` module to enable
provide similar Python functionality for Nim's strings. unbuffered I/O.
- Added ``center`` and ``rsplit`` to the ``strutils``
`(doc) <http://nim-lang.org/docs/strutils.html>`_ module
to provide similar Python functionality for Nim's strings.
- Added ``isTitle``, ``title``, ``swapCase``, ``isUpper``, ``toUpper``, - Added ``isTitle``, ``title``, ``swapCase``, ``isUpper``, ``toUpper``,
``isLower``, ``toLower``, ``isAlpha``, ``isSpace``, and ``capitalize`` ``isLower``, ``toLower``, ``isAlpha``, ``isSpace``, and ``capitalize``
to ``unicode.nim`` to provide unicode aware case manipulation and case to the ``unicode.nim``
`(doc) <http://nim-lang.org/docs/unicode.html>`_ module
to provide unicode aware case manipulation and case
testing. testing.
- Added a new module ``lib/pure/strmisc.nim`` to hold uncommon string - Added a new module ``strmisc``
`(doc) <http://nim-lang.org/docs/strmisc.html>`_
to hold uncommon string
operations. Currently contains ``partition``, ``rpartition`` operations. Currently contains ``partition``, ``rpartition``
and ``expandTabs``. and ``expandTabs``.
- Split out ``walkFiles`` in ``os.nim`` to three separate procs in order - Split out ``walkFiles`` in the ``os``
to make a clear distinction of functionality. ``walkPattern`` iterates `(doc) <http://nim-lang.org/docs/os.html>`_ module to three separate procs
in order to make a clear distinction of functionality. ``walkPattern`` iterates
over both files and directories, while ``walkFiles`` now only iterates over both files and directories, while ``walkFiles`` now only iterates
over files and ``walkDirs`` only iterates over directories. over files and ``walkDirs`` only iterates over directories.
- Added synchronous ``HttpClient`` in the ``httpclient`` module. - Added a synchronous ``HttpClient`` in the ``httpclient``
`(doc) <http://nim-lang.org/docs/httpclient.html>`_
module. The old
``get``, ``post`` and similar procedures are now deprecated in favour of it.
- Added a new macro called ``multisync`` allowing you to write procedures for - Added a new macro called ``multisync`` allowing you to write procedures for
synchronous and asynchronous sockets with no duplication. synchronous and asynchronous sockets with no duplication.
- The ``async`` macro will now complete ``FutureVar[T]`` parameters - The ``async`` macro will now complete ``FutureVar[T]`` parameters
automatically unless they have been completed already. automatically unless they have been completed already.
@ -112,22 +145,25 @@ Compiler Additions
- The ``-d/--define`` flag can now optionally take a value to be used - The ``-d/--define`` flag can now optionally take a value to be used
by code at compile time. by code at compile time.
`(doc) <http://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-time-define-pragmas>`_
Nimscript Additions Nimscript Additions
------------------- -------------------
- Finally it's possible to dis/enable specific hints and warnings in - It's possible to enable and disable specific hints and warnings in
Nimscript via the procs ``warning`` and ``hint``. Nimscript via the ``warning`` and ``hint`` procedures.
- Nimscript exports a proc named ``patchFile`` which can be used to - Nimscript exports a proc named ``patchFile`` which can be used to
patch modules or include files for different Nimble packages, including patch modules or include files for different Nimble packages, including
the ``stdlib`` package. the ``stdlib`` package.
Language Additions Language Additions
------------------ ------------------
- Added ``{.intdefine.}`` and ``{.strdefine.}`` macros to make use of - Added ``{.intdefine.}`` and ``{.strdefine.}`` macros to make use of
(optional) compile time defines. (optional) compile time defines.
`(doc) <http://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-time-define-pragmas>`_
- If the first statement is an ``import system`` statement then ``system`` - If the first statement is an ``import system`` statement then ``system``
is not imported implicitly anymore. This allows for code like is not imported implicitly anymore. This allows for code like
``import system except echo`` or ``from system import nil``. ``import system except echo`` or ``from system import nil``.
@ -138,7 +174,7 @@ Bugfixes
The list below has been generated based on the commits in Nim's git The list below has been generated based on the commits in Nim's git
repository. As such it lists only the issues which have been closed repository. As such it lists only the issues which have been closed
via a commit, for a full list see via a commit, for a full list see
`this link on Github <https://github.com/nim-lang/Nim/issues?utf8=%E2%9C%93&q=is%3Aissue+closed%3A%222016-06-22+..+2016-09-27%22+>`_. `this link on Github <https://github.com/nim-lang/Nim/issues?utf8=%E2%9C%93&q=is%3Aissue+closed%3A%222016-06-22+..+2016-09-28%22+>`_.
- Fixed "RFC: should startsWith and endsWith work with characters?" - Fixed "RFC: should startsWith and endsWith work with characters?"
(`#4252 <https://github.com/nim-lang/Nim/issues/4252>`_) (`#4252 <https://github.com/nim-lang/Nim/issues/4252>`_)