mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
19 lines
332 B
Nim
19 lines
332 B
Nim
discard """
|
|
output: '''@["aaa", "bbb", "ccc"]'''
|
|
"""
|
|
|
|
|
|
const
|
|
foo = @["aaa", "bbb", "ccc"]
|
|
|
|
proc myTuple: tuple[n: int, bar: seq[string]] =
|
|
result.n = 42
|
|
result.bar = newSeqOfCap[string](foo.len)
|
|
for f in foo:
|
|
result.bar.add(f)
|
|
|
|
# It works if you change the below `const` to `let`
|
|
const
|
|
(n, bar) = myTuple()
|
|
|
|
echo bar |