Expressions & functions12 / 68
Recursion & function values
Advanced definitions can call themselves, refer to another function or build a new named rule from existing ones.
Find it
Expressions

Try it step by step
- For recursion, start with a terminating base case.
- Define the recursive branch so that each call approaches that base case.
- Test a small input before trying a larger one.
- Use a named lambda or alias when you want to reuse a rule as a function value.
Examples to try
Each card is one input. For definitions, enter the cards in order. Formula-only cards belong in the tool described above.
Define a named function value.
Returns 9.
Reuse the rule under another name.
Compose the rules: apply f first, then g. Here is 16.
A rule with two inputs.
Fix the first input at 2. Now is 5.
A recursive factorial rule: the first branch stops the recursion. Try , which is 120.