.experimental can now be used to enable specific features
This commit is contained in:
parent
8ce9e43434
commit
ee366f1746
18 changed files with 122 additions and 116 deletions
|
|
@ -1397,10 +1397,10 @@ dereferencing operations for reference types:
|
|||
|
||||
Automatic dereferencing is also performed for the first argument of a routine
|
||||
call. But currently this feature has to be only enabled
|
||||
via ``{.experimental.}``:
|
||||
via ``{.experimental: "implicitDeref".}``:
|
||||
|
||||
.. code-block:: nim
|
||||
{.experimental.}
|
||||
{.experimental: "implicitDeref".}
|
||||
|
||||
proc depth(x: NodeObj): int = ...
|
||||
|
||||
|
|
@ -5588,7 +5588,7 @@ dot operators
|
|||
-------------
|
||||
|
||||
**Note**: Dot operators are still experimental and so need to be enabled
|
||||
via ``{.experimental.}``.
|
||||
via ``{.experimental: "dotOperators".}``.
|
||||
|
||||
Nim offers a special family of dot operators that can be used to
|
||||
intercept and rewrite proc call and field access attempts, referring
|
||||
|
|
@ -6885,17 +6885,12 @@ is uncertain (it may be removed any time).
|
|||
Example:
|
||||
|
||||
.. code-block:: nim
|
||||
{.experimental.}
|
||||
type
|
||||
FooId = distinct int
|
||||
BarId = distinct int
|
||||
using
|
||||
foo: FooId
|
||||
bar: BarId
|
||||
{.experimental: "parallel".}
|
||||
|
||||
proc useUsing(bar, foo) =
|
||||
echo "bar is of type BarId"
|
||||
echo "foo is of type FooId"
|
||||
parallel:
|
||||
for i in 0..4:
|
||||
echo "echo in parallel"
|
||||
|
||||
|
||||
Implementation Specific Pragmas
|
||||
|
|
@ -7917,7 +7912,7 @@ Example:
|
|||
|
||||
# Compute PI in an inefficient way
|
||||
import strutils, math, threadpool
|
||||
{.experimental.}
|
||||
{.experimental: "parallel".}
|
||||
|
||||
proc term(k: float): float = 4 * math.pow(-1, k) / (2*k + 1)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue