Inlining copies the lambda body into the call site, so `return` inside the lambda can return from the outer function (non-local return). `crossinline` forbids non-local returns when the lambda might be called later or in another context. `noinline` prevents inlining for a parameter so it can be stored/passed as a value.
Advanced answer
Deep dive
Expanding on the short answer — what usually matters in practice:
Explain the "why", not just the "what" (intuition + consequences).
Trade-offs: what you gain/lose (time, memory, complexity, risk).
Edge cases: empty inputs, large inputs, invalid inputs, concurrency.
Examples
A tiny example (an explanation template):
// Example: discuss trade-offs for "inline-lambdas-and-non-local-returns:-what-are-`"
function explain() {
// Start from the core idea:
// Inlining copies the lambda body into the call site, so `return` inside the lambda can retu
}
Common pitfalls
Too generic: no concrete trade-offs or examples.
Mixing average-case and worst-case (e.g., complexity).