Files
wren/test/language/implicit_call/module_variable.wren
Bob Nystrom 10f149f359 Add "def" syntax sugar for named function definitions.
This is technically redundant but it makes functional/procedural code
look a *lot* more natural.
2015-12-01 08:05:46 -08:00

9 lines
224 B
Plaintext

def f1(arg) { System.print(arg) }
f1("string") // expect: string
def f2(block) { System.print(block()) }
f2 { "block" } // expect: block
def f3(a, b, c) { System.print("%(a) %(b) %(c())") }
f3(1, 2) { 3 } // expect: 1 2 3