summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-12-25 00:01:12 +0200
committerZahary Karadjov <zahary@gmail.com>2013-12-25 00:32:53 +0200
commit952dbc4b8fd41bdf0f6b587147f62d8d15a95751 (patch)
treec61dd86b2d1719c2d869dce4508fb7990abd125c /lib
parent027f30610e44633b661befcca1b5dd39e9eaa283 (diff)
downloadNim-952dbc4b8fd41bdf0f6b587147f62d8d15a95751.tar.gz
documented static params
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim
index e58378c05..d45137b9e 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -2675,3 +2675,13 @@ proc locals*(): TObject {.magic: "Locals", noSideEffect.} =
   ## the official signature says, the return type is not ``TObject`` but a
   ## tuple of a structure that depends on the current scope.
   nil
+
+when not defined(booting):
+  type
+    semistatic*[T] = static[T] | T
+    # indicates a param of proc specialized for each static value,
+    # but also accepting run-time values
+
+  template isStatic*(x): expr = compiles(static(x))
+    # checks whether `x` is a value known at compile-time
+