diff --git a/src/c/list.d b/src/c/list.d index 9c5da745f..6f139f980 100644 --- a/src/c/list.d +++ b/src/c/list.d @@ -276,11 +276,6 @@ cl_return @ninth LENTH(8) cl_return @tenth LENTH(9) #undef LENTH -@(defun cons (car cdr) -@ - @(return CONS(car, cdr)) -@) - static bool tree_equal(cl_object x, cl_object y) { @@ -850,10 +845,17 @@ cl_return return1(output); } -@(defun acons (x y z) -@ +cl_object +cl_cons(cl_object x, cl_object y) +{ + @(return CONS(x, y)) +} + +cl_object +cl_acons(cl_object x, cl_object y, cl_object z) +{ @(return CONS(CONS(x, y), z)) -@) +} @(defun pairlis (keys data &optional a_list) cl_object k, d; diff --git a/src/c/symbols_list.h b/src/c/symbols_list.h index 4dd568ae7..9e3c3ccc1 100644 --- a/src/c/symbols_list.h +++ b/src/c/symbols_list.h @@ -70,7 +70,7 @@ cl_symbols[] = { {">", CL_ORDINARY, cl_G, -1}, {">=", CL_ORDINARY, cl_GE, -1}, {"ABS", CL_ORDINARY, NULL, -1}, -{"ACONS", CL_ORDINARY, cl_acons, -1}, +{"ACONS", CL_ORDINARY, cl_acons, 3}, {"ACOS", CL_ORDINARY, NULL, -1}, {"ACOSH", CL_ORDINARY, NULL, -1}, {"ADJOIN", CL_ORDINARY, cl_adjoin, -1}, @@ -237,7 +237,7 @@ cl_symbols[] = { {"COND", FORM_ORDINARY, NULL, -1}, {"CONDITION", CL_ORDINARY, NULL, -1}, {"CONJUGATE", CL_ORDINARY, cl_conjugate, 1}, -{"CONS", CL_ORDINARY, cl_cons, -1}, +{"CONS", CL_ORDINARY, cl_cons, 2}, {"CONSP", CL_ORDINARY, cl_consp, 1}, {"CONSTANTLY", CL_ORDINARY, NULL, -1}, {"CONSTANTP", CL_ORDINARY, cl_constantp, 1}, diff --git a/src/h/external.h b/src/h/external.h index 4c5779de7..bcc7563eb 100644 --- a/src/h/external.h +++ b/src/h/external.h @@ -565,10 +565,11 @@ extern cl_object cl_eighth(cl_object x); extern cl_object cl_ninth(cl_object x); extern cl_object cl_tenth(cl_object x); extern cl_object cl_nreconc(cl_object x, cl_object y); +extern cl_object cl_cons(cl_object x, cl_object y); +extern cl_object cl_acons(cl_object x, cl_object y, cl_object z); extern cl_object cl_list _ARGS((int narg, ...)); extern cl_object cl_listX _ARGS((int narg, ...)); extern cl_object cl_append _ARGS((int narg, ...)); -extern cl_object cl_cons _ARGS((int narg, cl_object car, cl_object cdr)); extern cl_object cl_tree_equal _ARGS((int narg, cl_object x, cl_object y, ...)); extern cl_object cl_endp _ARGS((int narg, cl_object x)); extern cl_object cl_list_length _ARGS((int narg, cl_object x)); @@ -601,7 +602,6 @@ extern cl_object cl_member_if_not _ARGS((int narg, cl_object pred, cl_object arg extern cl_object si_member1 _ARGS((int narg, cl_object item, cl_object list, ...)); extern cl_object cl_tailp _ARGS((int narg, cl_object y, cl_object x)); extern cl_object cl_adjoin _ARGS((int narg, cl_object item, cl_object list, cl_object k1, cl_object v1, cl_object k2, cl_object v2, cl_object k3, cl_object v3)); -extern cl_object cl_acons _ARGS((int narg, cl_object x, cl_object y, cl_object z)); extern cl_object cl_pairlis _ARGS((int narg, cl_object keys, cl_object data, ...)); extern cl_object cl_rassoc _ARGS((int narg, cl_object item, cl_object alist, ...)); extern cl_object cl_assoc _ARGS((int narg, cl_object item, cl_object alist, ...));