mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 22:58:40 +01:00
Add "def" syntax sugar for named function definitions.
This is technically redundant but it makes functional/procedural code look a *lot* more natural.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
var fn = Fn.new {
|
||||
def fn() {
|
||||
System.print(a)
|
||||
System.print(b)
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
var f = Fn.new {
|
||||
def f() {
|
||||
System.print(variable)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user