summaryrefslogtreecommitdiffstats
path: root/ffi.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-08 21:39:00 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-08 21:39:00 -0700
commitac117212b165ebb74209d79d0db1e40d275ee9f6 (patch)
treec9ff9733ebe26a3432fa6271921c7482c918b5d2 /ffi.c
parent38dc1622401faf4d11f7e9ddacca05703835530c (diff)
downloadtxr-ac117212b165ebb74209d79d0db1e40d275ee9f6.tar.gz
txr-ac117212b165ebb74209d79d0db1e40d275ee9f6.tar.bz2
txr-ac117212b165ebb74209d79d0db1e40d275ee9f6.zip
ffi: improve printed representation of closures.
* ffi.c (ffi_closure_print_op): Add information to the printed representation: the Lisp function, and call desc. Eliminate spurious # character before closing angle bracket.
Diffstat (limited to 'ffi.c')
-rw-r--r--ffi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ffi.c b/ffi.c
index 131801f3..87b6908c 100644
--- a/ffi.c
+++ b/ffi.c
@@ -201,9 +201,10 @@ static struct txr_ffi_closure *ffi_closure_struct_checked(val obj)
static void ffi_closure_print_op(val obj, val out,
val pretty, struct strm_ctx *ctx)
{
+ struct txr_ffi_closure *tfcl = ffi_closure_struct(obj);
put_string(lit("#<"), out);
obj_print_impl(obj->co.cls, out, pretty, ctx);
- put_string(lit("#>"), out);
+ format(out, lit(" ~s ~s>"), tfcl->fun, tfcl->call_desc, nao);
}
static void ffi_closure_destroy_op(val obj)