move since from inclrtl to std/private/since (#14188)
* move since from inclrtl to std/private/since * move since import in system below for HCR
This commit is contained in:
parent
3be669be32
commit
fbc97e712a
27 changed files with 60 additions and 59 deletions
19
lib/std/private/since.nim
Normal file
19
lib/std/private/since.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
template since*(version: (int, int), body: untyped) {.dirty.} =
|
||||
## Evaluates `body` if the ``(NimMajor, NimMinor)`` is greater than
|
||||
## or equal to `version`. Usage:
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## proc fun*() {.since: (1, 3).}
|
||||
## since (1, 3): fun()
|
||||
when (NimMajor, NimMinor) >= version:
|
||||
body
|
||||
|
||||
template since*(version: (int, int, int), body: untyped) {.dirty.} =
|
||||
## Evaluates `body` if ``(NimMajor, NimMinor, NimPatch)`` is greater than
|
||||
## or equal to `version`. Usage:
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## proc fun*() {.since: (1, 3, 1).}
|
||||
## since (1, 3, 1): fun()
|
||||
when (NimMajor, NimMinor, NimPatch) >= version:
|
||||
body
|
||||
Loading…
Add table
Add a link
Reference in a new issue