mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
@@ -54,6 +54,9 @@
|
||||
- `hashes.hash(proc|ptr|ref|pointer)` now calls `hash(int)` and honors `-d:nimIntHash1`,
|
||||
`hashes.hash(closure)` has also been improved.
|
||||
|
||||
- The unary slice `..b` was removed, use `0..b` instead or use `-d:nimLegacyUnarySlice`
|
||||
for a deprecation period.
|
||||
|
||||
## Standard library additions and changes
|
||||
- Added support for parenthesized expressions in `strformat`
|
||||
|
||||
|
||||
@@ -510,6 +510,16 @@ proc `..`*[T, U](a: sink T, b: sink U): HSlice[T, U] {.noSideEffect, inline, mag
|
||||
## echo a[2 .. 3] # @[30, 40]
|
||||
result = HSlice[T, U](a: a, b: b)
|
||||
|
||||
when defined(nimLegacyUnarySlice):
|
||||
proc `..`*[T](b: sink T): HSlice[int, T]
|
||||
{.noSideEffect, inline, magic: "DotDot", deprecated: "replace `..b` with `0..b`".} =
|
||||
## Unary `slice`:idx: operator that constructs an interval `[default(int), b]`.
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## let a = [10, 20, 30, 40, 50]
|
||||
## echo a[.. 2] # @[10, 20, 30]
|
||||
result = HSlice[int, T](a: 0, b: b)
|
||||
|
||||
when defined(hotCodeReloading):
|
||||
{.pragma: hcrInline, inline.}
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user