mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
20 lines
304 B
Nim
20 lines
304 B
Nim
discard """
|
|
output: '''Not found!
|
|
Found!'''
|
|
"""
|
|
|
|
const
|
|
md_extension = [".md", ".markdown"]
|
|
|
|
proc test(ext: string) =
|
|
case ext
|
|
of ".txt", md_extension:
|
|
echo "Found!"
|
|
else:
|
|
echo "Not found!"
|
|
|
|
test(".something")
|
|
# ensure it's not evaluated at compile-time:
|
|
var foo = ".markdown"
|
|
test(foo)
|