mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-16 07:14:07 +10:00
31 lines
303 B
Plaintext
31 lines
303 B
Plaintext
{
|
|
fn a() {
|
|
fn b() {
|
|
return 42;
|
|
}
|
|
|
|
return b;
|
|
}
|
|
|
|
assert a()() == 42, "function within function failed";
|
|
}
|
|
|
|
{
|
|
fn a() {
|
|
fn b() {
|
|
fn c() {
|
|
return 42;
|
|
}
|
|
|
|
return c;
|
|
}
|
|
|
|
return b;
|
|
}
|
|
|
|
assert a()()() == 42, "function within function within function failed";
|
|
}
|
|
|
|
|
|
print "All good";
|