Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Nested-function/Ecstasy/nested-function.ecstasy
Normal file
16
Task/Nested-function/Ecstasy/nested-function.ecstasy
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
module NestedFunction {
|
||||
static String makeList(String separator) {
|
||||
Int counter = 1;
|
||||
|
||||
function String(String) makeItem = item -> $"{counter++}{separator}{item}\n";
|
||||
|
||||
return makeItem("first")
|
||||
+ makeItem("second")
|
||||
+ makeItem("third");
|
||||
}
|
||||
|
||||
void run() {
|
||||
@Inject Console console;
|
||||
console.print(makeList(". "));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue