-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: First class functions #36
Comments
Do you mean that closures are currently not supported? I also noticed that you cannot assign a module-scoped variable either; the compilation ends with a nill pointer exception. |
Yes, exactly. The compilation of the following program will fail: package main
import "external"
func main() {
foo := 100
fn := func() {
external.Printf("foo = %d\n", foo) // error: use of undefined value '%foo-1'
}
fn()
} |
Got it! Any plans to implement Closures soon? :) I'd have a crack at it myself but I'm still learning the in/outs of LLVM :/ I certainl yknow how to implement Closures as I've done in monkey-lang and mio-lang |
I'd really like to implement closures one day, I've never implemented it in a language, so it should be a fun challenge! Inspiration to work on tre usually comes back when the winter arrives in the northern hemisphere, so I'll probably start hacking on this project again soon. |
That timing might work out in that case :) I won't put up a PR to give you a chance to hack and learn! I need to go learn LLVM anyway so I'm using your project tre as a basis to learn from (tinygo is a bit much of a codebase to learn from!) |
The text was updated successfully, but these errors were encountered: