work in progress: 'sink' and 'lent' types

This commit is contained in:
Araq 2018-01-07 10:17:19 +01:00
commit e316665b7b
5 changed files with 16 additions and 5 deletions

View file

@ -249,6 +249,10 @@ type
when defined(nimHasOpt):
type opt*{.magic: "Opt".}[T]
when defined(nimHasSink):
type sink*{.magic: "BuiltinType".}[T]
type lent*{.magic: "BuiltinType".}[T]
proc high*[T: Ordinal](x: T): T {.magic: "High", noSideEffect.}
## returns the highest possible index of an array, a sequence, a string or
## the highest possible value of an ordinal value `x`. As a special