You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support the outplace argument _, for the common case of sugar.dup where the outplace argument is assumed to be initialized to its default value for its (inferred) type.
Example
procmerge[T](result: varseq[T], x, y: openArray[T]) =...let x = [1,3]
let y = [2,5]
let a =merge(_, x, y)
let a2 = _.merge(x,y) # also works# same as:var a: seq[int]
merge(a, x, y)
a
implementation
requires compiler support.
in sigmatch, the arguments are implicitly reordered so that _ is matched last, at which point all generic parameters must be bound, or a sigmatch error occurs.
proposal
Support the outplace argument
_
, for the common case ofsugar.dup
where the outplace argument is assumed to be initialized to its default value for its (inferred) type.Example
implementation
_
is matched last, at which point all generic parameters must be bound, or a sigmatch error occurs.links
_
nim-lang/RFCs#292doAssert @[2,1,3].>sort() == @[1,2,3]
by timotheecour · Pull Request #13309 · nim-lang/Nimoutparam
: allows to call in-place a proc withvar result
; fixes #RFCs/issues/62 by timotheecour · Pull Request #11916 · nim-lang/NimThe text was updated successfully, but these errors were encountered: