Functions and Methods
- Q596: What is the difference between a function and a method in EK9?
- Q597: How do function parameters work in EK9?
- Q598: Why doesn't EK9 have default parameter values?
- Q599: Why doesn't EK9 have variable arguments (varargs)?
- Q600: How does method overloading work compared to function dispatching?
- Q601: How do dynamic functions replace nested functions in EK9?
- Q848: Can I assign an abstract function as a delegate in EK9?
- Q873: How do I write a pure function in EK9 that takes parameters and returns a result?
- Q942: How do I pass a function as a parameter in EK9?
- Q997: How do I write a function that returns a value in EK9?
- Q998: Show me different function signatures in EK9 — no params, one param, multiple params, with return.
- Q999: Write an EK9 function that takes a list of integers and returns the sum of all positive values.
- Q1001: How does a function return a value in EK9? There is no return keyword.
- Q1061: Write a reusable function that filters items above a threshold so I can call it from anywhere.
- Q1062: I need a simple one-off function to transform items in a stream pipeline.
- Q1063: Write a complete EK9 program that reads a list of scores, filters passing ones, and prints the results.
- Q1065: Write an EK9 class with comparison operators so I can sort a list of them.
- Q1072: Why does my abstract function get E08180 on the return value?
- Q1167: Write a function that returns a set or unset String depending on input.
- Q1168: Write a pure validation function that checks if an age is between 0 and 150.
- Q1169: Apply two transformations in sequence: double a number then add ten.
- Q1252: Write me an open logWriter function and a dynamic function instance that overrides its behaviour, demonstrating that 'as open' on a function allows dynamic instances to extend it.
- Q1253: Create me an abstract transformer function that a dynamic function instance can extend — showing that 'as abstract' on a function makes it implicitly open.
- Q1269: Write a higher-order function that takes a predicate and counts matching items in a list.
- Q1319: Why does EK9 reject an operator that takes a parameter but has no return declaration?
- Q1343: Why does EK9 reject a named argument whose name does not match the parameter?