Solidity REPL
Syntax & control flow

Tuple destructuring

Return several values and skip an unwanted tuple position.

Solidity 0.8.36REPL mode

Why use this example

Use this pattern to isolate Solidity branching, looping, assignment, and function-call syntax before combining it with contract state. The entry isolates tuple destructuring so its input, result, and state changes stay easy to compare.

Solidity to run

function sample() public pure returns (uint256, bool, uint256) {
  return (7, true, 42);
}

(uint256 first, , uint256 last) = sample()
first
last

Official Solidity reference

Compare this focused investigation with the complete language definition in the Solidity documentation.

Destructuring assignments

What to expect

The middle boolean is intentionally omitted while the first and final tuple positions return 7 and 42.

Continue the investigation

Change a value, add another expression, or open Inspect after the run. Accepted entries remain available to the next entry, and the clean replay keeps the complete result reproducible.

Read about writing Solidity Prototype Solidity behavior