Lisp-ops bound on oblist but not yet being used. All unit tests still pass.

This commit is contained in:
Simon Brooke 2017-01-20 12:05:10 +00:00
parent 1133a07752
commit 03dfe37045
7 changed files with 115 additions and 38 deletions

View file

@ -14,14 +14,40 @@
#include "version.h"
#include "conspage.h"
#include "consspaceobject.h"
#include "intern.h"
#include "lispops.h"
#include "print.h"
#include "read.h"
#include "lispops.h"
void bind_function( char* name, struct cons_pointer (*executable)
(struct stack_frame*, struct cons_pointer)) {
deep_bind( intern( c_string_to_lisp_string( name), oblist ),
make_function( NIL, executable));
}
void bind_special( char* name, struct cons_pointer (*executable)
(struct cons_pointer s_expr, struct cons_pointer env,
struct stack_frame* frame)) {
deep_bind( intern( c_string_to_lisp_string( name), oblist ),
make_special( NIL, executable));
}
int main (int argc, char *argv[]) {
fprintf( stderr, "Post scarcity software environment version %s\n", VERSION);
initialise_cons_pages();
bind_function( "assoc", &lisp_assoc);
bind_function( "car", &lisp_car);
bind_function( "cdr", &lisp_cdr);
bind_function( "cons", &lisp_cons);
bind_function( "eq", &lisp_eq);
bind_function( "equal", &lisp_equal);
bind_function( "read", &lisp_read);
bind_function( "print", &lisp_print);
bind_special( "apply", &lisp_apply);
bind_special( "eval", &lisp_eval);
fprintf( stderr, "\n:: ");
struct cons_pointer input = read( stdin);
fprintf( stderr, "\n{%d,%d}=> ", input.page, input.offset);