Nested function: Difference between revisions

Content added Content deleted
Line 531: Line 531:
=={{header|Ecstasy}}==
=={{header|Ecstasy}}==
<syntaxhighlight lang="java">
<syntaxhighlight lang="java">
module NestedFunction
module NestedFunction {
static String makeList(String separator) {
{
static String makeList(String separator)
{
Int counter = 1;
Int counter = 1;


Line 542: Line 540:
+ makeItem("second")
+ makeItem("second")
+ makeItem("third");
+ makeItem("third");
}
}


void run()
void run() {
{
@Inject Console console;
@Inject Console console;
console.print(makeList(". "));
console.print(makeList(". "));
}
}
}
}
</syntaxhighlight>
</syntaxhighlight>