mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 06:38:45 +01:00
This is technically redundant but it makes functional/procedural code look a *lot* more natural.
9 lines
224 B
Plaintext
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
|