Add environments
[fur] / c / environment.h
diff --git a/c/environment.h b/c/environment.h
new file mode 100644 (file)
index 0000000..ee4f784
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef ENVIRONMENT_H
+#define ENVIRONMENT_H
+
+#include <stdbool.h>
+#include "symbol.h"
+#include "object.h"
+
+struct Environment;
+typedef struct Environment Environment;
+
+Environment* Environment_create(Environment*);
+
+struct EnvironmentGetResult;
+typedef struct EnvironmentGetResult EnvironmentGetResult;
+struct EnvironmentGetResult {
+  bool found;
+  Object* value;
+};
+
+EnvironmentGetResult Environment_get(Environment*, Symbol*);
+bool Environment_set(Environment*, Symbol*, Object*);
+
+#endif