]> git.lizzy.rs Git - nothing.git/blob - src/script/scope.h
TODO(#395)
[nothing.git] / src / script / scope.h
1 #ifndef SCOPE_H_
2 #define SCOPE_H_
3
4 #include "expr.h"
5 #include "builtins.h"
6
7 struct Scope
8 {
9     struct Expr expr;
10 };
11
12 // Scope is a stack of alists
13 // (((y . 20))
14 //  ((x . 10)
15 //   (name . "Alexey")))
16
17 struct Scope create_scope(Gc *gc);
18
19 struct Expr get_scope_value(const struct Scope *scope, struct Expr name);
20 void set_scope_value(Gc *gc, struct Scope *scope, struct Expr name, struct Expr value);
21 void push_scope_frame(Gc *gc, struct Scope *scope, struct Expr vars, struct Expr args);
22 void pop_scope_frame(Gc *gc, struct Scope *scope);
23
24 #endif  // SCOPE_H_