*** empty log message ***
This commit is contained in:
parent
16e9055337
commit
09ec0a1f10
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: eval.c,v 1.12 2005-09-20 12:06:51 bacon Exp $
|
||||
* $Id: eval.c,v 1.13 2005-09-24 08:16:02 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/lsp/lsp.h>
|
||||
@ -83,7 +83,7 @@ static xp_lsp_obj_t* make_func (xp_lsp_t* lsp, xp_lsp_obj_t* cdr, int is_macro)
|
||||
xp_lsp_make_macro (lsp->mem, formal, body):
|
||||
xp_lsp_make_func (lsp->mem, formal, body);
|
||||
if (func == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ static xp_lsp_obj_t* apply (
|
||||
// make a new frame.
|
||||
frame = xp_lsp_frame_new ();
|
||||
if (frame == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ static xp_lsp_obj_t* apply (
|
||||
if (xp_lsp_frame_insert_value (
|
||||
frame, XP_LSP_CAR(formal), value) == XP_NULL) {
|
||||
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
mem->brooding_frame = frame->link;
|
||||
xp_lsp_frame_free (frame);
|
||||
return XP_NULL;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: prim.c,v 1.7 2005-09-20 12:06:51 bacon Exp $
|
||||
* $Id: prim.c,v 1.8 2005-09-24 08:16:02 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/lsp/lsp.h>
|
||||
@ -251,7 +251,7 @@ xp_lsp_obj_t* xp_lsp_prim_cons (xp_lsp_t* lsp, xp_lsp_obj_t* args)
|
||||
|
||||
cons = xp_lsp_make_cons (lsp->mem, car, cdr);
|
||||
if (cons == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
|
||||
@ -283,7 +283,7 @@ xp_lsp_obj_t* xp_lsp_prim_set (xp_lsp_t* lsp, xp_lsp_obj_t* args)
|
||||
if (p2 == XP_NULL) return XP_NULL;
|
||||
|
||||
if (xp_lsp_set_value (lsp->mem, p1, p2) == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ xp_lsp_obj_t* xp_lsp_prim_setq (xp_lsp_t* lsp, xp_lsp_obj_t* args)
|
||||
if (p2 == XP_NULL) return XP_NULL;
|
||||
|
||||
if (xp_lsp_set_value (lsp->mem, p1, p2) == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ xp_lsp_obj_t* xp_lsp_prim_defun (xp_lsp_t* lsp, xp_lsp_obj_t* args)
|
||||
if (fun == XP_NULL) return XP_NULL;
|
||||
|
||||
if (xp_lsp_set_func (lsp->mem, XP_LSP_CAR(args), fun) == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
return fun;
|
||||
@ -392,7 +392,7 @@ xp_lsp_obj_t* xp_lsp_prim_demac (xp_lsp_t* lsp, xp_lsp_obj_t* args)
|
||||
if (mac == XP_NULL) return XP_NULL;
|
||||
|
||||
if (xp_lsp_set_func (lsp->mem, XP_LSP_CAR(args), mac) == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
return mac;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: prim_let.c,v 1.2 2005-09-20 09:17:06 bacon Exp $
|
||||
* $Id: prim_let.c,v 1.3 2005-09-24 08:16:02 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/lsp/prim.h>
|
||||
@ -17,7 +17,7 @@ static xp_lsp_obj_t* __prim_let (
|
||||
// create a new frame
|
||||
frame = xp_lsp_frame_new ();
|
||||
if (frame == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
//frame->link = lsp->mem->frame;
|
||||
@ -72,7 +72,7 @@ static xp_lsp_obj_t* __prim_let (
|
||||
return XP_NULL;
|
||||
}
|
||||
if (xp_lsp_frame_insert_value(frame, n, v) == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
if (sequential) lsp->mem->frame = frame->link;
|
||||
else lsp->mem->brooding_frame = frame->link;
|
||||
xp_lsp_frame_free (frame);
|
||||
@ -88,7 +88,7 @@ static xp_lsp_obj_t* __prim_let (
|
||||
return XP_NULL;
|
||||
}
|
||||
if (xp_lsp_frame_insert_value(frame, ass, lsp->mem->nil) == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
if (sequential) lsp->mem->frame = frame->link;
|
||||
else lsp->mem->brooding_frame = frame->link;
|
||||
xp_lsp_frame_free (frame);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: prim_math.c,v 1.5 2005-09-21 12:04:05 bacon Exp $
|
||||
* $Id: prim_math.c,v 1.6 2005-09-24 08:16:02 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/lsp/prim.h>
|
||||
@ -65,7 +65,7 @@ xp_lsp_obj_t* xp_lsp_prim_plus (xp_lsp_t* lsp, xp_lsp_obj_t* args)
|
||||
xp_lsp_make_real (lsp->mem, rvalue):
|
||||
xp_lsp_make_int (lsp->mem, ivalue);
|
||||
if (tmp == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ xp_lsp_obj_t* xp_lsp_prim_minus (xp_lsp_t* lsp, xp_lsp_obj_t* args)
|
||||
xp_lsp_make_real (lsp->mem, rvalue):
|
||||
xp_lsp_make_int (lsp->mem, ivalue);
|
||||
if (tmp == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ xp_lsp_obj_t* xp_lsp_prim_multiply (xp_lsp_t* lsp, xp_lsp_obj_t* args)
|
||||
xp_lsp_make_real (lsp->mem, rvalue):
|
||||
xp_lsp_make_int (lsp->mem, ivalue);
|
||||
if (tmp == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ xp_lsp_obj_t* xp_lsp_prim_divide (xp_lsp_t* lsp, xp_lsp_obj_t* args)
|
||||
xp_lsp_make_real (lsp->mem, rvalue):
|
||||
xp_lsp_make_int (lsp->mem, ivalue);
|
||||
if (tmp == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
|
||||
@ -324,7 +324,7 @@ xp_lsp_obj_t* xp_lsp_prim_modulus (xp_lsp_t* lsp, xp_lsp_obj_t* args)
|
||||
|
||||
tmp = xp_lsp_make_int (lsp->mem, ivalue);
|
||||
if (tmp == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: read.c,v 1.15 2005-09-20 11:19:15 bacon Exp $
|
||||
* $Id: read.c,v 1.16 2005-09-24 08:16:02 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <xp/lsp/lsp.h>
|
||||
@ -29,7 +29,7 @@
|
||||
#define TOKEN_ADD_CHAR(lsp,ch) \
|
||||
do { \
|
||||
if (xp_lsp_token_addc(&(lsp)->token, ch) == -1) { \
|
||||
lsp->errnum = XP_LSP_ERR_MEM; \
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY; \
|
||||
return -1; \
|
||||
} \
|
||||
} while (0)
|
||||
@ -95,18 +95,18 @@ static xp_lsp_obj_t* read_obj (xp_lsp_t* lsp)
|
||||
return read_quote (lsp);
|
||||
case TOKEN_INT:
|
||||
obj = xp_lsp_make_int (lsp->mem, TOKEN_IVALUE(lsp));
|
||||
if (obj == XP_NULL) lsp->errnum = XP_LSP_ERR_MEM;
|
||||
if (obj == XP_NULL) lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
xp_lsp_lock (obj);
|
||||
return obj;
|
||||
case TOKEN_REAL:
|
||||
obj = xp_lsp_make_real (lsp->mem, TOKEN_RVALUE(lsp));
|
||||
if (obj == XP_NULL) lsp->errnum = XP_LSP_ERR_MEM;
|
||||
if (obj == XP_NULL) lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
xp_lsp_lock (obj);
|
||||
return obj;
|
||||
case TOKEN_STRING:
|
||||
obj = xp_lsp_make_stringx (
|
||||
lsp->mem, TOKEN_SVALUE(lsp), TOKEN_SLENGTH(lsp));
|
||||
if (obj == XP_NULL) lsp->errnum = XP_LSP_ERR_MEM;
|
||||
if (obj == XP_NULL) lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
xp_lsp_lock (obj);
|
||||
return obj;
|
||||
case TOKEN_IDENT:
|
||||
@ -116,7 +116,7 @@ static xp_lsp_obj_t* read_obj (xp_lsp_t* lsp)
|
||||
else {
|
||||
obj = xp_lsp_make_symbolx (
|
||||
lsp->mem, TOKEN_SVALUE(lsp), TOKEN_SLENGTH(lsp));
|
||||
if (obj == XP_NULL) lsp->errnum = XP_LSP_ERR_MEM;
|
||||
if (obj == XP_NULL) lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
xp_lsp_lock (obj);
|
||||
}
|
||||
return obj;
|
||||
@ -175,7 +175,7 @@ static xp_lsp_obj_t* read_list (xp_lsp_t* lsp)
|
||||
p = (xp_lsp_obj_cons_t*)xp_lsp_make_cons (
|
||||
lsp->mem, lsp->mem->nil, lsp->mem->nil);
|
||||
if (p == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
xp_lsp_lock ((xp_lsp_obj_t*)p);
|
||||
@ -207,14 +207,14 @@ static xp_lsp_obj_t* read_quote (xp_lsp_t* lsp)
|
||||
|
||||
cons = xp_lsp_make_cons (lsp->mem, tmp, lsp->mem->nil);
|
||||
if (cons == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
xp_lsp_lock (cons);
|
||||
|
||||
cons = xp_lsp_make_cons (lsp->mem, lsp->mem->quote, cons);
|
||||
if (cons == XP_NULL) {
|
||||
lsp->errnum = XP_LSP_ERR_MEM;
|
||||
lsp->errnum = XP_LSP_ERR_MEMORY;
|
||||
return XP_NULL;
|
||||
}
|
||||
xp_lsp_lock (cons);
|
||||
|
Loading…
Reference in New Issue
Block a user