mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
20 lines
262 B
Nim
20 lines
262 B
Nim
discard """
|
|
output: '''is
|
|
finally
|
|
nice!'''
|
|
"""
|
|
|
|
import tables
|
|
|
|
const
|
|
foo = {"ah": "finally", "this": "is", "possible.": "nice!"}.toTable()
|
|
|
|
# protect against overly smart compiler:
|
|
var x = "this"
|
|
|
|
echo foo[x]
|
|
x = "ah"
|
|
echo foo[x]
|
|
x = "possible."
|
|
echo foo[x]
|