first steps of making 'opt' a first class type for Nim
This commit is contained in:
parent
e879da5791
commit
f7f3a25be8
20 changed files with 198 additions and 35 deletions
|
|
@ -246,6 +246,9 @@ type
|
|||
UncheckedArray* {.unchecked.}[T] = array[0, T]
|
||||
## Array with no bounds checking
|
||||
|
||||
when defined(nimHasOpt):
|
||||
type opt*{.magic: "Opt".}[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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue