newruntime: progress
This commit is contained in:
parent
3b14f0ed10
commit
b77a2037f8
4 changed files with 18 additions and 12 deletions
|
|
@ -145,8 +145,7 @@ proc setLen[T](s: var seq[T], newlen: Natural) =
|
|||
if newlen < s.len:
|
||||
shrink(s, newLen)
|
||||
else:
|
||||
var v: T # get the default value of 'v'
|
||||
grow(s, newLen, v)
|
||||
grow(s, newLen, default(T))
|
||||
|
||||
when false:
|
||||
proc resize[T](s: var NimSeqV2[T]) =
|
||||
|
|
|
|||
|
|
@ -1706,6 +1706,10 @@ proc `@`* [IDX, T](a: array[IDX, T]): seq[T] {.
|
|||
## echo @a # => @[1, 3, 5]
|
||||
## echo @b # => @['f', 'o', 'o']
|
||||
|
||||
when defined(nimHasDefault):
|
||||
proc default*(T: typedesc): T {.magic: "Default", noSideEffect.}
|
||||
## returns the default value of the type ``T``.
|
||||
|
||||
proc setLen*[T](s: var seq[T], newlen: Natural) {.
|
||||
magic: "SetLengthSeq", noSideEffect.}
|
||||
## Sets the length of seq `s` to `newlen`. ``T`` may be any sequence type.
|
||||
|
|
@ -4400,10 +4404,6 @@ when defined(genode):
|
|||
# and return to thread entrypoint.
|
||||
|
||||
|
||||
when defined(nimHasDefault):
|
||||
proc default*(T: typedesc): T {.magic: "Default", noSideEffect.}
|
||||
## returns the default value of the type ``T``.
|
||||
|
||||
import system/widestrs
|
||||
export widestrs
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue