*** empty log message ***

This commit is contained in:
hyung-hwan 2005-09-24 08:16:02 +00:00
parent 16e9055337
commit 09ec0a1f10
5 changed files with 29 additions and 29 deletions

View File

@ -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> #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_macro (lsp->mem, formal, body):
xp_lsp_make_func (lsp->mem, formal, body); xp_lsp_make_func (lsp->mem, formal, body);
if (func == XP_NULL) { if (func == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; return XP_NULL;
} }
@ -189,7 +189,7 @@ static xp_lsp_obj_t* apply (
// make a new frame. // make a new frame.
frame = xp_lsp_frame_new (); frame = xp_lsp_frame_new ();
if (frame == XP_NULL) { if (frame == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; return XP_NULL;
} }
@ -230,7 +230,7 @@ static xp_lsp_obj_t* apply (
if (xp_lsp_frame_insert_value ( if (xp_lsp_frame_insert_value (
frame, XP_LSP_CAR(formal), value) == XP_NULL) { 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; mem->brooding_frame = frame->link;
xp_lsp_frame_free (frame); xp_lsp_frame_free (frame);
return XP_NULL; return XP_NULL;

View File

@ -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> #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); cons = xp_lsp_make_cons (lsp->mem, car, cdr);
if (cons == XP_NULL) { if (cons == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; 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 (p2 == XP_NULL) return XP_NULL;
if (xp_lsp_set_value (lsp->mem, p1, p2) == 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; 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 (p2 == XP_NULL) return XP_NULL;
if (xp_lsp_set_value (lsp->mem, p1, p2) == 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; 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 (fun == XP_NULL) return XP_NULL;
if (xp_lsp_set_func (lsp->mem, XP_LSP_CAR(args), fun) == 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 XP_NULL;
} }
return fun; 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 (mac == XP_NULL) return XP_NULL;
if (xp_lsp_set_func (lsp->mem, XP_LSP_CAR(args), mac) == 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 XP_NULL;
} }
return mac; return mac;

View File

@ -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> #include <xp/lsp/prim.h>
@ -17,7 +17,7 @@ static xp_lsp_obj_t* __prim_let (
// create a new frame // create a new frame
frame = xp_lsp_frame_new (); frame = xp_lsp_frame_new ();
if (frame == XP_NULL) { if (frame == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; return XP_NULL;
} }
//frame->link = lsp->mem->frame; //frame->link = lsp->mem->frame;
@ -72,7 +72,7 @@ static xp_lsp_obj_t* __prim_let (
return XP_NULL; return XP_NULL;
} }
if (xp_lsp_frame_insert_value(frame, n, v) == 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; if (sequential) lsp->mem->frame = frame->link;
else lsp->mem->brooding_frame = frame->link; else lsp->mem->brooding_frame = frame->link;
xp_lsp_frame_free (frame); xp_lsp_frame_free (frame);
@ -88,7 +88,7 @@ static xp_lsp_obj_t* __prim_let (
return XP_NULL; return XP_NULL;
} }
if (xp_lsp_frame_insert_value(frame, ass, lsp->mem->nil) == 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; if (sequential) lsp->mem->frame = frame->link;
else lsp->mem->brooding_frame = frame->link; else lsp->mem->brooding_frame = frame->link;
xp_lsp_frame_free (frame); xp_lsp_frame_free (frame);

View File

@ -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> #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_real (lsp->mem, rvalue):
xp_lsp_make_int (lsp->mem, ivalue); xp_lsp_make_int (lsp->mem, ivalue);
if (tmp == XP_NULL) { if (tmp == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; 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_real (lsp->mem, rvalue):
xp_lsp_make_int (lsp->mem, ivalue); xp_lsp_make_int (lsp->mem, ivalue);
if (tmp == XP_NULL) { if (tmp == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; 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_real (lsp->mem, rvalue):
xp_lsp_make_int (lsp->mem, ivalue); xp_lsp_make_int (lsp->mem, ivalue);
if (tmp == XP_NULL) { if (tmp == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; 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_real (lsp->mem, rvalue):
xp_lsp_make_int (lsp->mem, ivalue); xp_lsp_make_int (lsp->mem, ivalue);
if (tmp == XP_NULL) { if (tmp == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; 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); tmp = xp_lsp_make_int (lsp->mem, ivalue);
if (tmp == XP_NULL) { if (tmp == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; return XP_NULL;
} }

View File

@ -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> #include <xp/lsp/lsp.h>
@ -29,7 +29,7 @@
#define TOKEN_ADD_CHAR(lsp,ch) \ #define TOKEN_ADD_CHAR(lsp,ch) \
do { \ do { \
if (xp_lsp_token_addc(&(lsp)->token, ch) == -1) { \ if (xp_lsp_token_addc(&(lsp)->token, ch) == -1) { \
lsp->errnum = XP_LSP_ERR_MEM; \ lsp->errnum = XP_LSP_ERR_MEMORY; \
return -1; \ return -1; \
} \ } \
} while (0) } while (0)
@ -95,18 +95,18 @@ static xp_lsp_obj_t* read_obj (xp_lsp_t* lsp)
return read_quote (lsp); return read_quote (lsp);
case TOKEN_INT: case TOKEN_INT:
obj = xp_lsp_make_int (lsp->mem, TOKEN_IVALUE(lsp)); 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); xp_lsp_lock (obj);
return obj; return obj;
case TOKEN_REAL: case TOKEN_REAL:
obj = xp_lsp_make_real (lsp->mem, TOKEN_RVALUE(lsp)); 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); xp_lsp_lock (obj);
return obj; return obj;
case TOKEN_STRING: case TOKEN_STRING:
obj = xp_lsp_make_stringx ( obj = xp_lsp_make_stringx (
lsp->mem, TOKEN_SVALUE(lsp), TOKEN_SLENGTH(lsp)); 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); xp_lsp_lock (obj);
return obj; return obj;
case TOKEN_IDENT: case TOKEN_IDENT:
@ -116,7 +116,7 @@ static xp_lsp_obj_t* read_obj (xp_lsp_t* lsp)
else { else {
obj = xp_lsp_make_symbolx ( obj = xp_lsp_make_symbolx (
lsp->mem, TOKEN_SVALUE(lsp), TOKEN_SLENGTH(lsp)); 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); xp_lsp_lock (obj);
} }
return 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 ( p = (xp_lsp_obj_cons_t*)xp_lsp_make_cons (
lsp->mem, lsp->mem->nil, lsp->mem->nil); lsp->mem, lsp->mem->nil, lsp->mem->nil);
if (p == XP_NULL) { if (p == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; return XP_NULL;
} }
xp_lsp_lock ((xp_lsp_obj_t*)p); 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); cons = xp_lsp_make_cons (lsp->mem, tmp, lsp->mem->nil);
if (cons == XP_NULL) { if (cons == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; return XP_NULL;
} }
xp_lsp_lock (cons); xp_lsp_lock (cons);
cons = xp_lsp_make_cons (lsp->mem, lsp->mem->quote, cons); cons = xp_lsp_make_cons (lsp->mem, lsp->mem->quote, cons);
if (cons == XP_NULL) { if (cons == XP_NULL) {
lsp->errnum = XP_LSP_ERR_MEM; lsp->errnum = XP_LSP_ERR_MEMORY;
return XP_NULL; return XP_NULL;
} }
xp_lsp_lock (cons); xp_lsp_lock (cons);