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(". ")); } }