implemented 'experimental' switch

This commit is contained in:
Araq
2014-12-05 10:09:29 +01:00
parent e27ab36731
commit 4b7de4dc5e
12 changed files with 49 additions and 7 deletions

View File

@@ -91,4 +91,5 @@ Advanced options:
--verbosity:0|1|2|3 set Nim's verbosity level (1 is default)
--cs:none|partial set case sensitivity level (default: none);
do not use! this setting affects the whole language
--experimental enable experimental language features
-v, --version show detailed version information

View File

@@ -495,3 +495,21 @@ identifier that can be used to enable or disable it:
This is often better than disabling all warnings at once.
experimental pragma
-------------------
The ``experimental`` pragma enables experimental language features. Depending
on the concrete feature this means that the feature is either considered
too unstable for an otherwise stable release or that the future of the feature
is uncertain (it may be removed any time).
Example:
.. code-block:: nim
{.experimental.}
proc useUsing(dest: var string) =
using dest
add "foo"
add "bar"

View File

@@ -488,7 +488,8 @@ Instead of:
Using statement
---------------
**Warning**: The ``using`` statement is highly experimental!
**Warning**: The ``using`` statement is highly experimental and has to be
explicitly enabled with the `experimental`:idx: pragma or command line option!
The using statement provides syntactic convenience for procs that
heavily use a single contextual parameter. When applied to a variable or a