add anonymous functions

This commit is contained in:
William Bell
2025-08-26 02:13:48 +01:00
parent 6ad0b2c02e
commit db650d8ccf
4 changed files with 139 additions and 3 deletions

View File

@@ -5,11 +5,33 @@ let say_hi(name) = do
do
return name
)
return "hello "+u+", how are you?"
term.log(say_hi("william"))
return "hello "+u+", how are you?"
term.log(say_hi("william")
, say_hi)
let a = 9
let b = 10
term.log(string(a)+'+'+string(b)+'='+string(a+b))
term.log(string(a)+'+'+string(b)+'='+string(a+b))
let call(f) = do
term.log(f)
return f()
term.log(
call(
()=call(
()=call(
()=call(
()=do
term.log("hello this is a test of anonymous functions. hopefully this works :)")
return say_hi("test")
)
)
)
)
)