From e89a65fe2ea7911fa20502818e0af6d702d68be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Th=C3=B6rnros?= Date: Mon, 11 Jan 2021 13:01:22 +0100 Subject: Variables and scoping --- todo | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 todo (limited to 'todo') diff --git a/todo b/todo new file mode 100644 index 0000000..d4bde7e --- /dev/null +++ b/todo @@ -0,0 +1,53 @@ + - [x] Better error messages + - [x] Rustify the thingy + - [x] Return errors from runtime +---[-]-REPR---- + - [x] Pass files + + - [?] Globals + - [x] Variables + - [x] Scoping + - [ ] Jumps + - [ ] Type annotations + - [ ] If + - [ ] Listor + - [ ] For + - [ ] Prepass, for typeing + - [ ] Typing + - [ ] Functions + + +global_names = {"name" => idx} +gloabls [(type var1), (type var2), (type var3)...] + +==== q.tdy ==== +use z +// Is this a closure? Yes. +f := () -> { + print a +} + +f := () -> { +} + + + +a int := a + 1 +a int := 3 +a := 3 + +let : + +a : int = 123 +a := z.a + +==== z.tdy ==== +use q // Will we need imports? Yes. + +q.f() // What does this print? 123. q has a different scope. + +g := () -> { + print a +} + +a := q.a // Compilation error -- cgit v1.2.1