summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-06-06 20:33:31 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-06-06 20:35:41 +0200
commit5d4380dd0c7ee74af7f0b7d9bebce903a8c82517 (patch)
tree56e3fa9b2783e4a4a6c02d485b0cbfa8c7fbe671
parentc863ea00acd45f2312cd119e47df795d04abde81 (diff)
downloadNim-5d4380dd0c7ee74af7f0b7d9bebce903a8c82517.tar.gz
news updates for the upcoming release; fixes #4090
-rw-r--r--web/news/version_0_14_released.rst.todo38
1 files changed, 33 insertions, 5 deletions
diff --git a/web/news/version_0_14_released.rst.todo b/web/news/version_0_14_released.rst.todo
index 7aa4e0359..050714249 100644
--- a/web/news/version_0_14_released.rst.todo
+++ b/web/news/version_0_14_released.rst.todo
@@ -40,7 +40,8 @@ Changes affecting backwards compatibility
   Nim.
 - The path handling changed. The project directory is not added to the
   search path automatically anymore. Add this line to your project's
-  config to get back the old behaviour: ``--path:"$projectdir"``.
+  config to get back the old behaviour: ``--path:"$projectdir"``. (Do
+  not replace ``$projectdir`` by the project's directory!
 - The ``round`` function in ``math.nim`` now returns a float and has been
   corrected such that the C implementation always rounds up from .5 rather
   than changing the operation for even and odd numbers.
@@ -51,7 +52,7 @@ Changes affecting backwards compatibility
   than meaning 2.285 GB as in the previous implementation).  By default it
   also uses IEC prefixes (KiB, MiB) etc and optionally uses colloquial names
   (kB, MB etc) and the (SI-preferred) space.
-- The ``==`` operator for ``cstring`` now implements a value comparision
+- The ``==`` operator for ``cstring`` now implements a value comparison
   for the C backend (using ``strcmp``), not reference comparisons anymore.
   Convert the cstrings to pointers if you really want reference equality
   for speed.
@@ -61,10 +62,37 @@ Changes affecting backwards compatibility
   both ``asynchttpserver`` and ``httpclient``.
 
 
+Generic type classes
+~~~~~~~~~~~~~~~~~~~~
+
+Generic type classes are now handled properly in the compiler, but this
+means code like the following does not compile any longer:
+
+.. code-block:: nim
+  type
+    Vec3[T] = distinct array[3, T]
+
+  proc vec3*[T](a, b, c: T): Vec3[T] = Vec3([a, b, c])
+
+While every ``Vec3[T]`` is part of the ``Vec3`` type class, the reverse
+is not true, not every ``Vec3`` is a ``Vec3[T]``. Otherwise there would
+be a subtype relation between ``Vec3[int]`` and ``Vec3[float]`` and there
+is none for Nim. The fix is to write this instead:
+
+.. code-block:: nim
+  type
+    Vec3[T] = distinct array[3, T]
+
+  proc vec3*[T](a, b, c: T): Vec3[T] = Vec3[T]([a, b, c])
+
+Note that in general we don't advise to use ``distinct array``,
+use ``object`` instead.
+
+
 Library Additions
 -----------------
 
-- The rlocks module has been added providing reentrant lock synchronization
+- The rlocks module has been added providing a reentrant lock synchronization
   primitive.
 - A generic "sink operator" written as ``&=`` has been added to the ``system`` and the ``net`` modules.
 - Added ``strscans`` module that implements a ``scanf`` for easy input extraction.
@@ -89,7 +117,9 @@ Language Additions
 ------------------
 
 - Nim now supports a ``.this`` pragma for more notational convenience.
+  See `manual.html#overloading-resolution-automatic-self-insertions`_ for more information.
 - Nim now supports a different ``using`` statement for more convenience.
+  Consult `manual.html#statements-and-expressions-using-statement`_ for more information.
 - ``include`` statements are not restricted to top level statements anymore.
 
 ..
@@ -110,8 +140,6 @@ via a commit, for a full list see
     (`#3496 <https://github.com/nim-lang/Nim/issues/3496>`_)
   - Fixed "JS backend - strange utf-8 handling"
     (`#3714 <https://github.com/nim-lang/Nim/issues/3714>`_)
-  - Fixed "JS backend - strange utf-8 handling"
-    (`#3714 <https://github.com/nim-lang/Nim/issues/3714>`_)
   - Fixed "execvpe is glibc specific"
     (`#3759 <https://github.com/nim-lang/Nim/issues/3759>`_)
   - Fixed "GC stack overflow with in data structures with circular references."