mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
31 lines
422 B
Nim
31 lines
422 B
Nim
discard """
|
|
output: '''
|
|
dynamic: let
|
|
dynamic: var
|
|
static: const
|
|
static: literal
|
|
static: constant folding
|
|
static: static string
|
|
'''
|
|
"""
|
|
|
|
proc foo(s: string) =
|
|
echo "dynamic: ", s
|
|
|
|
proc foo(s: static[string]) =
|
|
echo "static: ", s
|
|
|
|
let l = "let"
|
|
var v = "var"
|
|
const c = "const"
|
|
|
|
type staticString = static[string]
|
|
|
|
foo(l)
|
|
foo(v)
|
|
foo(c)
|
|
foo("literal")
|
|
foo("constant" & " " & "folding")
|
|
foo(staticString("static string"))
|
|
|