mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 19:02:18 +00:00
16 lines
316 B
Nim
16 lines
316 B
Nim
discard """
|
|
action: run
|
|
"""
|
|
|
|
block:
|
|
var x = (a: 5, b: 1)
|
|
x = (3 * x.a + 2 * x.b, x.a + x.b)
|
|
doAssert x.a == 17
|
|
doAssert x.b == 6
|
|
block:
|
|
# Transformation of a tuple constructor with named arguments
|
|
var x = (a: 5, b: 1)
|
|
x = (a: 3 * x.a + 2 * x.b, b: x.a + x.b)
|
|
doAssert x.a == 17
|
|
doAssert x.b == 6
|