Solidity REPL
Syntax & control flow

Named function arguments

Call a function with named arguments in a different order.

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 named function arguments so its input, result, and state changes stay easy to compare.

Solidity to run

function quote(uint256 amount, uint256 price) public pure returns (uint256) {
  return amount * price;
}

quote({ price: 7, amount: 6 })

Official Solidity reference

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

Named function parameters

What to expect

The named call supplies price before amount while Solidity matches both names and returns 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