mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
20 lines
244 B
Nim
20 lines
244 B
Nim
discard """
|
|
output: '''ABC
|
|
nope'''
|
|
"""
|
|
|
|
template canImport(x): bool =
|
|
compiles:
|
|
import x
|
|
|
|
when canImport(strutils):
|
|
import strutils
|
|
echo "abc".toUpperAscii
|
|
else:
|
|
echo "meh"
|
|
|
|
when canImport(none):
|
|
echo "what"
|
|
else:
|
|
echo "nope"
|