projects
/
muddle-interpreter.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement NTH.
[muddle-interpreter.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index 6645f6e4564f72f72f67d1bea7949761452be844..5ecbcd8352344a389080641efa68a3063ec79775 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-16,10
+16,12
@@
License along with this file. If not, see
<http://www.gnu.org/licenses/>.
*/
<http://www.gnu.org/licenses/>.
*/
+#include "atom.h"
#include "read.h"
#include "eval.h"
#include "print.h"
#include "object.h"
#include "read.h"
#include "eval.h"
#include "print.h"
#include "object.h"
+#include "oblist.h"
#include <stdio.h>
#include <sys/mman.h>
#include <stdio.h>
#include <sys/mman.h>
@@
-30,6
+32,10
@@
pool_object *pool;
pool_ptr ptop;
object *vhp_base;
heap_ptr vhp;
pool_ptr ptop;
object *vhp_base;
heap_ptr vhp;
+vector_object globals;
+
+// oblists (move to ASOCs once implemented)
+uvector_object root;
// TODO: store these in current PROCESS
frame *cf;
// TODO: store these in current PROCESS
frame *cf;
@@
-50,6
+56,8
@@
enum
READER_OBJCT = 64
};
READER_OBJCT = 64
};
+void init_standard_env ();
+
int
main ()
{
int
main ()
{
@@
-81,11
+89,14
@@
main ()
// Entire toplevel becomes `for (;;) cf->cont.fn();`
char buf[512];
ssize_t n;
// Entire toplevel becomes `for (;;) cf->cont.fn();`
char buf[512];
ssize_t n;
+ // no GC (leak everything)
+ ptop = 1;
+ vhp = 1;
+ root = oblist_create (13);
+ globals = vector_create (64);
+ init_standard_env ();
while ((n = read (STDIN_FILENO, buf, sizeof (buf))) > 0)
{
while ((n = read (STDIN_FILENO, buf, sizeof (buf))) > 0)
{
- // mock GC (no object persistence)
- ptop = 1;
- vhp = 1;
// terminate input
assert (buf[n - 1] == '\n');
buf[n - 1] = '\0';
// terminate input
assert (buf[n - 1] == '\n');
buf[n - 1] = '\0';
@@
-112,6
+123,11
@@
main ()
// Print the thing
print_object (&ret);
printf ("\n");
// Print the thing
print_object (&ret);
printf ("\n");
+ /*
+ // debugging oblists...
+ print_object ((object*) &root);
+ printf ("\n");
+ */
// Loop!
}
// Loop!
}