diff --git a/src/pebblisp.c b/src/pebblisp.c index 2676a40..092a2d7 100644 --- a/src/pebblisp.c +++ b/src/pebblisp.c @@ -528,9 +528,9 @@ Object typeCheck(const char* funcName, Object* params, int length, } for (int i = 0; i < typeLength - 1; i++) { - if (typeChecks[i].checkFunc && !typeChecks[i].checkFunc(params[i])) { // TODO: Use pl func name instead of C function name. + if (typeChecks[i].checkFunc && !typeChecks[i].checkFunc(params[i])) { char context[128]; - sprintf(context, "When calling %s, expected %s, but received %s", funcName, typeChecks[i].name, getTypeName(¶ms[i])); + sprintf(context, "When calling (%s), expected %s, but received %s.", funcName, typeChecks[i].name, getTypeName(¶ms[i])); return errorWithContextLineNo(BAD_PARAMS, context, 0, NULL); } } diff --git a/src/pebblisp.h b/src/pebblisp.h index f4ff740..e3ebc8c 100644 --- a/src/pebblisp.h +++ b/src/pebblisp.h @@ -92,7 +92,7 @@ Object typeCheck(const char* funcName, Object* params, int length, #endif #ifndef DISABLE_TYPE_CHECKS -#define checkTypes(FUNC) int FAILED; Object ERROR = typeCheck(#FUNC, params, length, FUNC ## TypeChecks, array_length(FUNC ## TypeChecks), &FAILED); \ +#define checkTypes(FUNC) int FAILED; Object ERROR = typeCheck(FUNC ## Symbol, params, length, FUNC ## TypeChecks, array_length(FUNC ## TypeChecks), &FAILED); \ if (FAILED) { \ return ERROR; \ }