if you want to roll your own, import macros type MaybeStatic[T] = static[T] | T template constLet[T](id:untyped, v:MaybeStatic[T]) = when v is static: const id = v else: let id = v proc f(x:MaybeStatic[int]) = constLet(y,x) expandMacros: echo y f(3) var x = 2 f(x) Run
- Compile time check for let ShalokShalom
- Compile time check for let juancarlospaco
- Compile time check for let Yardanico
- Compile time check for let ShalokShalom
- Compile time check for let jxy
- Compile time check for let Araq
- Compile time check for let cblake
- Compile time check for let snej
- Compile time check for let ShalokShalom
- Compile time check for let snej
- Compile time check for let jibal
- Compile time check for let cblake
- Compile time check for let ShalokShalom
- Compile time check for let juancarlospaco
- Compile time check for let jibal