mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-26 09:14:00 +00:00
implemented 'experimental' switch
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user