8 |
#include <dlfcn.h> |
#include <dlfcn.h> |
9 |
/* assert */ |
/* assert */ |
10 |
#include <assert.h> |
#include <assert.h> |
11 |
|
/* strcat */ |
12 |
|
#include <string.h> |
13 |
|
|
14 |
#define HASHTBLSIZE 65536 |
#define HASHTBLSIZE 65536 |
15 |
|
|
408 |
push_val(&(env->head), val); /* Return its bound value */ |
push_val(&(env->head), val); /* Return its bound value */ |
409 |
} |
} |
410 |
|
|
|
extern void pack(environment*); |
|
411 |
void stack_read(environment*, char*); |
void stack_read(environment*, char*); |
412 |
|
|
|
|
|
413 |
/* If the top element is a symbol, determine if it's bound to a |
/* If the top element is a symbol, determine if it's bound to a |
414 |
function value, and if it is, toss the symbol and execute the |
function value, and if it is, toss the symbol and execute the |
415 |
function. */ |
function. */ |
418 |
funcp in_func; |
funcp in_func; |
419 |
value* temp_val; |
value* temp_val; |
420 |
stackitem* iterator; |
stackitem* iterator; |
421 |
|
char* temp_string; |
422 |
|
|
423 |
if(env->head==NULL) { |
if(env->head==NULL) { |
424 |
printerr("Too Few Arguments"); |
printerr("Too Few Arguments"); |
472 |
env->head->item->refcount++; |
env->head->item->refcount++; |
473 |
toss(env); |
toss(env); |
474 |
if(env->err) return; |
if(env->err) return; |
475 |
push_sym(env, "["); |
temp_string= malloc(strlen((char*)temp_val->content.ptr)+5); |
476 |
env->non_eval_flag++; |
strcat(temp_string, "[ "); |
477 |
stack_read(env, (char*)temp_val->content.ptr); |
strcat(temp_string, (char*)temp_val->content.ptr); |
478 |
env->non_eval_flag--; |
strcat(temp_string, " ]"); |
479 |
push_sym(env, "["); pack(env); |
stack_read(env, temp_string); |
|
if(env->err) return; |
|
480 |
eval(env); |
eval(env); |
481 |
if(env->err) return; |
if(env->err) return; |
482 |
free_val(temp_val); |
free_val(temp_val); |
483 |
|
free(temp_string); |
484 |
break; |
break; |
485 |
|
|
486 |
default: |
default: |