RosettaCodeData/Task/Scope-Function-names-and-labels/Wren/scope-function-names-and-labels.wren
2023-07-01 13:44:08 -04:00

14 lines
374 B
Text

//func.call() /* invalid, can't call func before its declared */
var func = Fn.new { System.print("func has been called.") }
func.call() // fine
//C.init() /* not OK, as C is null at this point */
class C {
static init() { method() } // fine even though 'method' not yet declared
static method() { System.print("method has been called.") }
}
C.init() // fine