diff --git a/include/picrin.h b/include/picrin.h index 7f029fcf..e2d938e1 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -212,8 +212,8 @@ void pic_warn(pic_state *, const char *); const char *pic_errmsg(pic_state *); -void pic_debug(pic_state *, pic_value); -void pic_fdebug(pic_state *, pic_value, XFILE *); +pic_value pic_debug(pic_state *, pic_value); +pic_value pic_fdebug(pic_state *, pic_value, XFILE *); #if defined(__cplusplus) } diff --git a/src/write.c b/src/write.c index 4925d52a..e96cf706 100644 --- a/src/write.c +++ b/src/write.c @@ -154,17 +154,18 @@ write(pic_state *pic, pic_value obj, XFILE *file) } } -void +pic_value pic_debug(pic_state *pic, pic_value obj) { - pic_fdebug(pic, obj, xstdout); + return pic_fdebug(pic, obj, xstdout); } -void +pic_value pic_fdebug(pic_state *pic, pic_value obj, XFILE *file) { write(pic, obj, file); xfflush(file); + return obj; } static pic_value