FIND YOUR NEXT FEW LINES

Results for “Function scope & composition”

Small, practical examples. Search by task or narrow things down below.

137 snippets foundClear filters
RustFunctions & data types

Accept different types with a generic function

Accept different types with a generic function in a complete Rust program using the standard library.

Rust✓ Tested
Docker / ComposeNetworks & volume metadata

Assign a network-scoped alias

Docker / Compose: An alias gives an endpoint an additional name on that network.

Docker / Compose✓ Tested
RustThreads & shared ownership

Borrow local data in a scoped thread

Borrow local data in a scoped thread in a complete Rust program using the standard library.

Rust✓ Tested
PythonFunctions & error handling

Cache repeated pure function calls

Python: Use lru_cache to avoid recomputing results for identical hashable arguments.

Python✓ Tested
GoGetting Started

Call a function with a return value

Call a function with a return value using a complete Go program with explicit sample inputs.

Go✓ Tested
PythonGetting Started

Call a library function

Python: Use a standard absolute-value function with a small negative number.

Python✓ Tested
C#Getting Started

Call a library function

C#: Use a standard absolute-value function with a small negative number.

C#✓ Tested
JavaGetting Started

Call a library function

Java: Use a standard absolute-value function with a small negative number.

Java✓ Tested
JavaScriptGetting Started

Call a library function

JavaScript: Use a standard absolute-value function with a small negative number.

JavaScript✓ Tested
TypeScriptGetting Started

Call a library function

TypeScript: Use a standard absolute-value function with a small negative number.

TypeScript✓ Tested
C++Getting Started

Call a library function

C++: Use a standard absolute-value function with a small negative number.

C++✓ Tested
CGetting Started

Call a library function

C: Use a standard absolute-value function with a small negative number.

C✓ Tested