diff options
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/system.nim b/lib/system.nim index db1d3ca1e..e8b427c55 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -106,8 +106,6 @@ type SomeNumber* = SomeInteger|SomeFloat ## type class matching all number types -{.deprecated: [SomeReal: SomeFloat].} - proc defined*(x: untyped): bool {.magic: "Defined", noSideEffect, compileTime.} ## Special compile-time procedure that checks whether `x` is ## defined. @@ -2041,11 +2039,11 @@ proc getRefcount*[T](x: seq[T]): int {.importc: "getRefcount", noSideEffect, const - Inf* {.magic: "Inf".} = 1.0 / 0.0 + Inf* = 0x7FF0000000000000'f64 ## contains the IEEE floating point value of positive infinity. - NegInf* {.magic: "NegInf".} = -Inf + NegInf* = 0xFFF0000000000000'f64 ## contains the IEEE floating point value of negative infinity. - NaN* {.magic: "NaN".} = 0.0 / 0.0 + NaN* = 0x7FF7FFFFFFFFFFFF'f64 ## contains an IEEE floating point value of *Not A Number*. Note ## that you cannot compare a floating point value to this value ## and expect a reasonable result - use the `classify` procedure @@ -2056,7 +2054,7 @@ const NimMinor* {.intdefine.}: int = 19 ## is the minor number of Nim's version. - NimPatch* {.intdefine.}: int = 1 + NimPatch* {.intdefine.}: int = 9 ## is the patch number of Nim's version. NimVersion*: string = $NimMajor & "." & $NimMinor & "." & $NimPatch @@ -2253,10 +2251,10 @@ proc min*(x, y: float): float {.magic: "MinF64", noSideEffect.} = proc max*(x, y: float): float {.magic: "MaxF64", noSideEffect.} = if y <= x: x else: y -proc min*[T](x, y: T): T = +proc min*[T](x, y: T): T {.inline.}= if x <= y: x else: y -proc max*[T](x, y: T): T = +proc max*[T](x, y: T): T {.inline.}= if y <= x: x else: y {.pop.} @@ -4019,6 +4017,7 @@ proc shallow*[T](s: var seq[T]) {.noSideEffect, inline.} = ## marks a sequence `s` as `shallow`:idx:. Subsequent assignments will not ## perform deep copies of `s`. This is only useful for optimization ## purposes. + if s.len == 0: return when not defined(JS) and not defined(nimscript): var s = cast[PGenericSeq](s) s.reserved = s.reserved or seqShallowFlag @@ -4029,6 +4028,8 @@ proc shallow*(s: var string) {.noSideEffect, inline.} = ## purposes. when not defined(JS) and not defined(nimscript) and not defined(gcDestructors): var s = cast[PGenericSeq](s) + if s == nil: + s = cast[PGenericSeq](newString(0)) # string literals cannot become 'shallow': if (s.reserved and strlitFlag) == 0: s.reserved = s.reserved or seqShallowFlag @@ -4039,8 +4040,6 @@ type NimNode* {.magic: "PNimrodNode".} = ref NimNodeObj ## represents a Nim AST node. Macros operate on this type. -{.deprecated: [PNimrodNode: NimNode].} - when false: template eval*(blk: typed): typed = ## executes a block of code at compile time just as if it was a macro |