Programming Search⌘K

Conceptcore

Parameter passing

Also called evaluation strategy, call by value, call by reference, call by sharing, call by name, pass by value, pass by reference, named arguments, default arguments, variadic functions.

Parameter passing is how the arguments of a call reach the parameters of a function: as copies, as references to variables, as shared objects or as unevaluated expressions.

Applies to
core-languages

Idea

A function declares parameters, and a call supplies arguments. The Python FAQ states the difference: "Parameters are defined by the names that appear in a function definition, whereas arguments are the values actually passed to a function when calling it."1 Parameter passing is the rule that connects the two. It answers three questions. What does the parameter get: a copy of the value, the variable of the caller, or an expression that is not evaluated yet? Which argument goes to which parameter: by position, by name, or both? What happens when the call has fewer or more arguments than the function has parameters?

The first question decides what a function can change. In this Python example, the function changes the list of the caller but not the variable total:

def update(items, count):
    items.append(4)
    items = [0]
    count += 1


numbers = [1, 2, 3]
total = 1
update(numbers, total)
print(numbers, total)
Output
[1, 2, 3, 4] 1

items and numbers refer to the same list, so append changes it. The assignments to items and count only change the local names. Most modern languages behave like this, and programmers often argue whether to call it "by value" or "by reference". It is neither in the old sense of those words.

How it works

Call by value. The parameter is a new local variable, and the value of the argument is copied into it before the body runs. The ALGOL 60 report describes the effect "as though an additional block embracing the procedure body were created" with an assignment to each value parameter.2 C works this way: "each parameter is assigned the value of the corresponding argument", and the standard adds that a function "may change the values of its parameters, but these changes cannot affect the values of the arguments".3 To let a function change a variable of the caller, C passes a pointer to it. The pointer is copied, but the copy points to the same object. Java states the same rule for methods: "the values of the actual argument expressions initialize newly created parameter variables".4 The Go FAQ is short: "everything in Go is passed by value", and "passing a pointer value makes a copy of the pointer, but not the data it points to".5

Call by reference. The parameter is another name for the variable of the caller. An assignment to the parameter is an assignment to that variable. Fortran compilers used this method, and Pascal has it with var parameters. In C++, a parameter of type T& is a reference, and cppreference shows a double_string(std::string& s) that changes the string of main.6 C# has the modifiers ref, out, in and ref readonly. Both the declaration and the call must write ref or out, so a reader of the call can see that the variable can change. An out argument needs no value before the call, and the method must assign it before it returns.7 Call by reference needs an argument that is a variable. A call such as f(x + 1) has no variable to refer to.

Call by sharing. In Python, Java, JavaScript, Ruby and many other languages, a variable holds a reference to an object. Passing an argument copies the reference, so the caller and the function share the object, but not the variable. Barbara Liskov described this model for CLU: there "is no call-by-reference. Instead arguments are passed 'by object'; the (pointer to the) object resulting from evaluating the actual argument expression is assigned to the formal. (Thus passing a parameter is just doing an assignment to the formal.)"8 The Python FAQ says the same: "arguments are passed by assignment in Python", and "consequently no call-by-reference".1 MDN describes JavaScript in the same way. A new value assigned to a parameter "is not reflected globally or in the code which called that function", but a change to the properties of an object argument is visible outside.9 So the rule for these languages is simple. Mutation of the shared object is visible. Rebinding of the parameter is not.

Moves and borrows. Rust passes by value, but a value of a type that owns resources moves into the function. "Passing a variable to a function will move or copy, just as assignment does."10 After the move, the caller cannot use the variable. To lend a value without a move, the caller passes a shared reference &T or a mutable reference &mut T. The compiler checks that a borrow does not outlive the value and that a mutable borrow is the only access at that time. C++ has a similar idea with rvalue references and std::move, but the compiler does not stop the use of a moved-from object.

Call by name. In ALGOL 60, a parameter that is not in the value list is "replaced, throughout the procedure body, by the corresponding actual parameter".2 The argument expression is evaluated again at each use of the parameter, in the environment of the caller. An implementation passes a small procedure, called a thunk, that computes the expression. Call by name lets a procedure take an expression such as a[i] and see a new element each time that it changes i. It is hard to implement efficiently and hard to reason about, and later languages dropped it. Lazy evaluation in Haskell is call by need: the expression is evaluated at the first use, and the result is kept for later uses.

Copy-in, copy-out. A parameter can also get a copy of the value at the call and copy its final value back to the variable of the caller at the return. This is call by value-result. Ada defines in, out and in out modes and lets the compiler pass a scalar in out parameter by copy. The difference from call by reference can be seen only when the same variable is passed twice or is also visible as a global.

Matching arguments to parameters. Most languages match arguments by position. Named arguments, also called keyword arguments, match by name: Python, C#, Kotlin, Swift and PostgreSQL have them. PostgreSQL states the reason: named notation "makes the associations between parameters and actual arguments more explicit and reliable".11 Python can force a style. Parameters after * are keyword-only, as PEP 3102 defines them, and parameters before / are positional-only, as PEP 570 defines them.1213

Default values. A parameter with a default value can be left out of the call. The language must say when the default is evaluated. Python evaluates it once: "Default parameter values are evaluated from left to right when the function definition is executed", so a mutable default is shared by all the calls.14 JavaScript evaluates the default at each call, and MDN contrasts this with Python.15 C++ evaluates a default argument at each call too. Kotlin has default values and named arguments, which replace many overloads.16

Variadic parameters. A function can take any number of arguments: *args in Python, ...rest in JavaScript, int... values in Java, params int[] in C#, ...int in Go and ... with <stdarg.h> in C. In the typed languages other than C, the extra arguments arrive as an array or a slice of one type. The C form has no type check of the extra arguments.

In languages

LanguageVerdictNote
PythonNative
C++Native
JavaNative
CNative
C#Native
JavaScriptNative
TypeScriptNative
GoNative
RustNative
KotlinNativeArguments are passed by value as on the JVM, with default values, named arguments and vararg parameters; no example file because kotlinc is not installed on the machine that recorded the examples.
SQLNativeSQL routines have IN, OUT and INOUT parameters, and PostgreSQL calls a function with positional, named or mixed notation; no example file because the examples run on SQLite, which has no functions written in SQL.
BashNative
PowerShellNativeFunctions and scripts have named parameters with types, default values, switches and validation in a param block; no example file because pwsh is not installed on the machine that recorded the examples.
HTMLDoes not applyHTML has no functions.
CSSAbsentThe @function rule for custom functions with parameters is a draft and is not in all browsers. Alternative: Custom properties with var() and a fallback value.
Regular expressionsDoes not applyA regular expression has no functions.
Language Verdict Default mode By-reference form Named arguments
Python native sharing none yes
JavaScript native sharing none no, use an object
TypeScript native sharing none no, use an object
Java native value, references for objects none no
Kotlin native value, references for objects none yes
C# native value ref, out, in yes
Go native value pointers no
Rust native move or copy &, &mut no
C native value pointers no
C++ native value T&, const T&, T&& no
Bash native strings by value a variable name no
PowerShell native value, references for objects [ref] yes
SQL native value OUT, INOUT yes, in PostgreSQL
Regex, HTML n/a
CSS absent

Python passes by assignment. Default values are evaluated once. * and / in the parameter list make keyword-only and positional-only parameters.

JavaScript passes each value by value, and an object value is a reference. Defaults are evaluated at each call. The language does not check the number of arguments, so a function can get more or fewer than it declares. TypeScript adds a check of the number and the types.

Java passes all arguments by value and has varargs. It has no default values or named arguments. Kotlin has the same model on the JVM and adds default values and named arguments.

C# passes by value by default and has explicit by-reference modifiers that the call must repeat. It has optional parameters, named arguments and params.

Go passes by value. A pointer, a slice, a map or a channel is a small value that refers to shared data. Go has variadic parameters but no defaults and no named arguments.

Rust moves or copies each argument. References are explicit at the call: &x or &mut x.

C passes by value. Arrays become pointers, so the length is a separate argument.

C++ adds references, default arguments and variadic templates to the C model.

Bash passes strings as positional parameters. A function returns a string by printing it, or by assigning to a variable whose name the caller passes.

PythonGitHub
def update(items, count):
    items.append(4)
    items = [0]
    count += 1
    return items, count


numbers = [1, 2, 3]
total = 1
print(update(numbers, total))
print(numbers, total)


def connect(host, /, port=5432, *, timeout):
    return f"{host}:{port} timeout={timeout}"


print(connect("db", timeout=5))
print(connect("db", 6543, timeout=1))
Output
([0], 2)
[1, 2, 3, 4] 1
db:5432 timeout=5
db:6543 timeout=1
  • Verdict: native. Python passes arguments by assignment. The parameter becomes a new name for the same object as the argument. A change to the object, such as append, is visible to the caller. A new assignment to the parameter only changes the local name.
  • Parameters before / are positional-only, and parameters after * are keyword-only. A default value is evaluated once, when the def statement runs.
  • *args collects extra positional arguments in a tuple, and **kwargs collects extra keyword arguments in a dictionary.

This code runs but gives a wrong answer on purpose.

def swap(a, b):
    a, b = b, a


x, y = 1, 2
swap(x, y)
print(x, y)
Output
1 2

The function rebinds its own names a and b. The names x and y of the caller do not change. Return the values and assign them: x, y = y, x.

#include <iostream>
#include <string>
#include <vector>

void by_value(std::vector<int> v) { v.push_back(0); }
void by_reference(std::vector<int>& v) { v.push_back(4); }
std::size_t by_const_reference(const std::vector<int>& v) { return v.size(); }
std::string greet(const std::string& name, const std::string& greeting = "hello") {
    return greeting + ", " + name;
}

int main() {
    std::vector<int> numbers{1, 2, 3};
    by_value(numbers);
    by_reference(numbers);
    std::cout << by_const_reference(numbers) << "\n";
    std::cout << greet("ann") << "\n";
}
Output
4
hello, ann
  • Verdict: native. C++ passes by value unless the parameter is a reference. T& lets the function change the variable of the caller, and const T& avoids a copy of a large object without a change.
  • An rvalue reference T&& and std::move let a function take the resources of an argument that the caller no longer needs.
  • C++ has default arguments, function overloading and variadic templates. It has no named arguments. Designated initializers of a struct are the usual replacement.

This code runs but gives a wrong answer on purpose.

#include <iostream>
#include <vector>

void add(std::vector<int> v, int x) {
    v.push_back(x);
}

int main() {
    std::vector<int> numbers{1, 2, 3};
    add(numbers, 4);
    std::cout << numbers.size() << "\n";
}
Output
3

The parameter is a std::vector<int>, not a reference, so the function adds to a copy. Each call also copies all the elements. Declare the parameter as std::vector<int>& v.

JavaGitHub
import java.util.ArrayList;
import java.util.List;

public class Main {
    static void update(List<Integer> items, int count) {
        items.add(4);
        items = new ArrayList<>();
        count++;
    }

    static int sum(int... values) {
        int total = 0;
        for (int v : values) {
            total += v;
        }
        return total;
    }

    public static void main(String[] args) {
        List<Integer> numbers = new ArrayList<>(List.of(1, 2, 3));
        int count = 1;
        update(numbers, count);
        System.out.println(numbers + " " + count);
        System.out.println(sum() + " " + sum(1, 2, 3));
    }
}
Output
[1, 2, 3, 4] 1
0 6
  • Verdict: native. Java passes all arguments by value. The values of the argument expressions initialize new parameter variables. For a reference type, the value is a reference, so the method can change the object but not the variable of the caller.
  • A varargs parameter int... values receives the extra arguments as an array.
  • Java has no default values and no named arguments. Overloads and builder objects are the usual replacements.

This code runs but gives a wrong answer on purpose.

public class Main {
    static void swap(Integer a, Integer b) {
        Integer t = a;
        a = b;
        b = t;
    }

    public static void main(String[] args) {
        Integer x = 1;
        Integer y = 2;
        swap(x, y);
        System.out.println(x + " " + y);
    }
}
Output
1 2

The method swaps its own copies of the two references. Java has no way to pass a variable by reference.

#include <stdio.h>

static void swap(int *a, int *b) {
    int t = *a;
    *a = *b;
    *b = t;
}

static int sum(const int *values, size_t n) {
    int total = 0;
    for (size_t i = 0; i < n; i++) {
        total += values[i];
    }
    return total;
}

int main(void) {
    int x = 1, y = 2;
    swap(&x, &y);
    int numbers[] = {1, 2, 3, 4};
    printf("%d %d %d\n", x, y, sum(numbers, sizeof numbers / sizeof numbers[0]));
    return 0;
}
Output
2 1 10
  • Verdict: native. C passes arguments by value: "each parameter is assigned the value of the corresponding argument". A function changes a variable of the caller only through a pointer to it.
  • An array argument becomes a pointer to its first element. The function does not get the length, so the caller passes it as a separate argument.
  • C has variadic functions with ... and <stdarg.h>, but they have no type check of the extra arguments. C has no default values and no named arguments.

This code runs but gives a wrong answer on purpose.

#include <stdio.h>

static size_t count(int values[10]) {
    return sizeof values / sizeof values[0];
}

int main(void) {
    int numbers[10] = {0};
    printf("%zu %zu\n", sizeof numbers / sizeof numbers[0], count(numbers));
    return 0;
}
Output
10 2

The parameter int values[10] is adjusted to int *values. Inside the function, sizeof values is the size of a pointer, 8 bytes on a 64-bit machine, not the size of the array. GCC and Clang warn with -Wsizeof-array-argument.

static void Increment(ref int n) => n++;

static bool TryHalf(int n, out int half)
{
    half = n / 2;
    return n % 2 == 0;
}

static double Length(in (double X, double Y) p) => Math.Sqrt(p.X * p.X + p.Y * p.Y);

static int Sum(params int[] values) => values.Sum();

static string Connect(string host, int port = 5432, bool ssl = false) =>
    $"{host}:{port} ssl={ssl}";

int count = 1;
Increment(ref count);
Console.WriteLine(count);

Console.WriteLine(TryHalf(10, out int half) + " " + half);
Console.WriteLine(Length((3, 4)));
Console.WriteLine(Sum(1, 2, 3));
Console.WriteLine(Connect("db", ssl: true));
Output
2
True 5
5
6
db:5432 ssl=True
  • Verdict: native. By default, C# passes arguments by value. The modifiers ref, out, in and ref readonly pass a variable by reference. Both the declaration and the call must say ref or out, so the reader of the call can see that the variable can change.
  • An out parameter does not need a value before the call, and the method must assign it before it returns.
  • C# has optional parameters with default values, named arguments and params parameters.

This code runs but gives a wrong answer on purpose.

static void Move(Point p) => p.X += 10;

var point = new Point { X = 1 };
Move(point);
Console.WriteLine(point.X);

struct Point
{
    public int X;
}
Output
1

Point is a struct, so the method gets a copy. The change goes to the copy. Pass it as ref Point p, or return the new value.

JavaScriptGitHub
function update(car, year) {
  car.make = "Toyota";
  car = { make: "Honda" };
  year += 1;
  return [car.make, year];
}

const myCar = { make: "Ford" };
const myYear = 1999;
console.log(update(myCar, myYear));
console.log(myCar.make, myYear);

function collect(item, list = []) {
  list.push(item);
  return list;
}

console.log(collect(1), collect(2));

function connect({ host, port = 5432 } = {}, ...flags) {
  return `${host}:${port} ${flags.join(",")}`;
}

console.log(connect({ host: "db" }, "ssl", "ro"));
Output
[ 'Honda', 2000 ]
Toyota 1999
[ 1 ] [ 2 ]
db:5432 ssl,ro
  • Verdict: native. JavaScript passes each argument by value. When the value is an object, the parameter refers to the same object, so a change to a property is visible to the caller. A new assignment to the parameter is not.
  • A default value is evaluated at each call in which the argument is missing or undefined. So each call to collect gets a new array. Python does the opposite.
  • There are no named arguments. A destructured object parameter is the usual replacement. A rest parameter ...flags collects the remaining arguments in an array.

This code runs but gives a wrong answer on purpose.

console.log(["10", "10", "10"].map(parseInt));
Output
[ 10, NaN, 2 ]

map calls its callback with three arguments: the element, the index and the array. parseInt takes a second parameter, the radix. So the calls are parseInt("10", 0), parseInt("10", 1) and parseInt("10", 2). JavaScript does not check the number of arguments. Use .map((s) => parseInt(s, 10)).

TypeScriptGitHub
interface Options {
  host: string;
  port?: number;
  retries?: number;
}

function connect({ host, port = 5432, retries = 3 }: Options): string {
  return `${host}:${port} retries=${retries}`;
}

function sum(first: number, ...rest: number[]): number {
  return rest.reduce((total, n) => total + n, first);
}

console.log(connect({ host: "db" }));
console.log(connect({ host: "db", retries: 0 }));
console.log(sum(1, 2, 3));
Output
db:5432 retries=3
db:5432 retries=0
6
  • Verdict: native. TypeScript keeps the rules of JavaScript, and the type checker adds a check of the number and types of the arguments. A call with a missing required argument is error TS2554.
  • An optional parameter has a ? or a default value. An options object with an interface is the usual way to get named arguments.
  • The runner of this page strips the types without a check, so the page cannot show the error as a fails block.
package main

import "fmt"

func update(items []int, count int, p *int) {
	items[0] = 100
	count++
	*p++
}

func sum(values ...int) int {
	total := 0
	for _, v := range values {
		total += v
	}
	return total
}

func main() {
	numbers := []int{1, 2, 3}
	count, other := 1, 1
	update(numbers, count, &other)
	fmt.Println(numbers, count, other)
	fmt.Println(sum(), sum(numbers...))
}
Output
[100 2 3] 1 2
0 105
  • Verdict: native. "Everything in Go is passed by value." A function gets a copy of each argument. A pointer is copied, but it points to the same variable, so *p++ changes the variable of the caller.
  • A slice value is a small descriptor with a pointer, a length and a capacity. The copy shares the array, so a change to an element is visible to the caller.
  • A variadic parameter ...int receives a slice. sum(numbers...) passes an existing slice without a copy.
  • Go has no default values and no named arguments.

This code runs but gives a wrong answer on purpose.

package main

import "fmt"

func add(items []int, v int) {
	items = append(items, v)
}

func main() {
	numbers := make([]int, 0, 4)
	add(numbers, 1)
	fmt.Println(numbers, len(numbers))
}
Output
[] 0

append returns a new slice header. The function changes its own copy of the header, and the length of the caller's slice stays 0. Return the new slice, numbers = add(numbers, 1), or pass a pointer to the slice.

RustGitHub
fn consume(s: String) -> usize {
    s.len()
}

fn read(s: &str) -> usize {
    s.len()
}

fn append(s: &mut String) {
    s.push_str(" world");
}

fn main() {
    let mut text = String::from("hello");
    println!("{}", read(&text));
    append(&mut text);
    println!("{text}");
    let n = consume(text);
    println!("{n}");
}
Output
5
hello world
11
  • Verdict: native. Passing a value to a function moves it or copies it, as an assignment does. A type that implements Copy, such as i32, is copied. Other types, such as String, move, and the caller cannot use the variable after the call.
  • A shared reference &T lends the value for reading. A mutable reference &mut T lends it for change, and the call must write &mut too.
  • Rust has no default values, no named arguments and no variadic functions, except for C functions. Builder types, Option parameters and macros fill those roles.

This code does not compile, on purpose.

fn consume(s: String) -> usize {
    s.len()
}

fn main() {
    let text = String::from("hello");
    let n = consume(text);
    println!("{n} {text}");
}

The call moves text into consume. The compiler rejects the later use with error E0382. Pass &text if the function only reads the string.

BashGitHub
count_args() {
  echo "$# arguments, first: $1"
}

set_result() {
  printf -v "$1" 'done at step %s' "$2"
}

files=("a.txt" "my notes.txt")
count_args "${files[@]}"
set_result status 3
echo "$status"
Output
2 arguments, first: a.txt
done at step 3
  • Verdict: native. A function gets its arguments as the positional parameters $1, $2 and so on, and $# is their count. The arguments are strings, and they are passed by value.
  • A function can only return an exit status. To return a string, it prints it, or it assigns to a variable whose name the caller passes. printf -v assigns to a variable by name. Bash 4.3 and later also have local -n, a name reference.
  • There are no named parameters and no declared parameter list.

This code runs but gives a wrong answer on purpose.

count_args() {
  echo "$# arguments, first: $1"
}

files=("a.txt" "my notes.txt")
count_args ${files[@]}
Output
3 arguments, first: a.txt

Without quotes, the shell splits my notes.txt into two words. Write "${files[@]}" and "$@" to pass each element as one argument.

  • Receivers. A method call obj.m() passes obj as a hidden first parameter. Go and Rust make the mode of the receiver explicit: func (p *T) or &mut self.
  • Currying and partial application. A function of two parameters can be a function of one parameter that returns a function of one parameter. Some languages fix some arguments of a function to make a new function.
  • Closures. A closure captures variables from the scope around it. The capture is another way to give data to a function, and it has the same choices of copy or reference. See closures.
  • Out parameters and multiple results. Languages with tuples or multiple return values, such as Python, Go and Rust, rarely need out parameters. C# keeps out for the TryParse pattern.
  • Calling conventions. At the machine level, the ABI decides which arguments go in registers and which go on the stack. This is how call by value is implemented, not a different rule.
  • Higher-order functions. A parameter can be a function. See higher-order functions.

Pitfalls

  • Rebinding is not changing. In Python, Java and JavaScript, an assignment to a parameter does not change the variable of the caller. A swap function that only assigns its parameters has no effect.
  • Mutation of a shared object. A function that changes an argument object changes it for the caller too. Copy the object first if the caller does not expect the change.
  • A mutable default in Python. def f(items=[]) shares one list between all the calls that use the default.
  • A slice header in Go. append inside a function changes the copy of the slice header, and the length of the caller's slice does not change.
  • A struct copy in C# or C++. A method that changes a struct parameter changes a copy.
  • Array size in C. sizeof of an array parameter is the size of a pointer.
  • Extra arguments in JavaScript. ["10", "10", "10"].map(parseInt) passes the index as the radix.
  • Boolean arguments by position. connect(host, true, false) is hard to read. Use named arguments, an options object or an enum.
  • Unquoted arguments in shell scripts. $@ without quotes splits arguments with spaces into many words.

Cost

Call by value copies the argument. For a small value, such as an integer or a pointer, the copy is a register move and costs nothing. For a large struct or a container in C++, the copy can allocate memory and take time proportional to the size. Pass a const T& in C++, a &T in Rust or a pointer in Go and C to avoid it. Call by sharing never copies the object, only the reference.

Call by reference makes aliasing possible. If a function has two reference parameters, the compiler cannot assume that they refer to different objects, so it must reload values from memory after each write. C has the restrict qualifier to promise that they do not overlap. Rust gets the same guarantee from the borrow rules.

Call by name and lazy evaluation make each argument a small closure. The closure costs an allocation, and in call by name the expression is evaluated at each use.

History

The ALGOL 60 report of 1960 defined two modes: value parameters, assigned before the body runs, and name parameters, replaced in the body by the text of the argument.2 Fortran compilers of the same period passed the address of the argument, which is call by reference. Pascal, in 1970, kept value parameters and replaced call by name with var parameters, which are passed by reference. C, in 1972, passed everything by value and used pointers for the rest. CLU, designed at MIT from 1973, passed arguments "by object", and the same model is used by Smalltalk, Python, Java, JavaScript and Ruby.8 Ada, in 1983, described parameters by their direction, in, out and in out, and not by the mechanism. C++ added references in the 1980s and rvalue references in C++11. Rust, in 2015, made moves the default and made borrows explicit and checked.

References

  1. Programming FAQ, Python 3.14, What is the difference between arguments and parameters? How do I write a function with output parameters (call by reference)?
  2. Revised Report on the Algorithmic Language ALGOL 60, P. Naur (ed.), Communications of the ACM 6(1), 1963, 4.7.3 Semantics of procedure statements
  3. ISO/IEC 9899:201x Committee Draft N1570, 6.5.2.2 Function calls, paragraph 4 and footnote 93
  4. The Java Language Specification, Java SE 25 Edition, 8.4.1 Formal Parameters
  5. Frequently Asked Questions (FAQ), The Go Programming Language, When are function parameters passed by value?
  6. Reference declaration, cppreference.com, Lvalue references
  7. Method parameters and modifiers, C# reference, Microsoft Learn, ref parameter modifier, out parameter modifier
  8. A History of CLU, Barbara Liskov, MIT LCS TR-561, 1992, 3.5 Semantic Model
  9. Functions, MDN Web Docs, Function parameters
  10. The Rust Programming Language, What Is Ownership?, Ownership and Functions
  11. PostgreSQL Documentation, Calling Functions, 4.3 Calling Functions
  12. PEP 3102, Keyword-Only Arguments, Abstract, Specification
  13. PEP 570, Python Positional-Only Parameters, Abstract, Specification
  14. The Python Language Reference, Compound statements, Python 3.14, 8.7 Function definitions
  15. Default parameters, MDN Web Docs, Evaluated at call time
  16. Kotlin documentation, Functions, Parameters with default values, Named arguments

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/W3XADK/text.yaml