mkhan45 / RustScript2

RustScript is a functional scripting language with as much relation to Rust as Javascript has to Java.
https://mkhan45.github.io/RustScript2/
Other
36 stars 2 forks source link

Handling mutually recursive functions #34

Closed mkhan45 closed 2 years ago

mkhan45 commented 2 years ago

Right now a workaround is to declare functions inside of each other

mkhan45 commented 2 years ago

I guess the solution is to add all top level function definitions to the static state and add them to every closure def

mkhan45 commented 2 years ago

This wouldn't work, maybe the solution is to make a different type of thunk for when the function name isn't resolved at definition time

mkhan45 commented 2 years ago

I think that to do this we need to differentiate between closures and lambdas