<http://www.gnu.org/licenses/>.
*/
+#include "atom.h"
#include "read.h"
#include "eval.h"
#include "print.h"
#include "object.h"
+#include "oblist.h"
#include <stdio.h>
#include <sys/mman.h>
// TODO: put these in interpreter-wide ctx object
pool_object *pool;
pool_ptr ptop;
-char *vhp_base;
-char *vhp;
+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;
READER_OBJCT = 64
};
+void init_standard_env ();
+
int
main ()
{
vhp_base =
mmap (0, VECTOR_OBJCT * sizeof (object), PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- vhp = vhp_base;
+ vhp = 1;
// Reader stack (TODO: dynamically allocate as VECTOR).
object rst_base[READER_OBJCT];
{
// mock GC (no object persistence)
ptop = 1;
- vhp = vhp_base;
+ vhp = 1;
+ root = oblist_create (13);
+ globals = vector_create (64);
+ init_standard_env ();
// terminate input
assert (buf[n - 1] == '\n');
buf[n - 1] = '\0';
// Eval the thing
cf->prevcst = cst;
push_frame (eval, new_tuple (st.pos, 1), 0);
- while (cf->cont.fn)
+ while (cf->cont.val.fn)
{
- cf->cont.fn ();
+ cf->cont.val.fn ();
}
// Print the thing
print_object (&ret);
printf ("\n");
+ /*
+ // debugging oblists...
+ print_object ((object*) &root);
+ printf ("\n");
+ */
// Loop!
}