MontysCoconut / moco

The Monty to LLVM compiler
http://www.informatik.uni-bremen.de/monty/
GNU General Public License v3.0
10 stars 5 forks source link

Closures and bug fixes #41

Closed cpfr closed 8 years ago

cpfr commented 8 years ago

This pull request implements closures (i.e. function objects that capture the enclosing environment) and fixes some bugs regarding function objects (in particular anonymous functions).

Additionally, core library functions can now explicitly declared native by adding @native to their declaration. This way, it is possible to implement both, LLVM and Monty core functionality without weird implicit rules for native and non-native implementations. This is done in this merge request and not separately, because there was no good way to determine whether a function declaration was native in the code generation (which is required, since native functions can not be closures).

lummax commented 8 years ago

Let's give others some time to look over this, but fine with me. Merge whenever you want :).