summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib.c19
-rw-r--r--tests/012/struct.tl2
2 files changed, 19 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index d31a06bb..b912e9b0 100644
--- a/lib.c
+++ b/lib.c
@@ -7380,7 +7380,24 @@ finish:
format(out, lit("#<package: ~s>"), obj->pk.name, nao);
break;
case FUN:
- format(out, lit("#<function: type ~a>"), num(obj->f.functype), nao);
+ {
+ struct func *f = &obj->f;
+ if (f->functype == FINTERP) {
+ val fun = f->f.interp_fun;
+ format(out, lit("#<interpreted fun: ~s ~s>"),
+ car(fun), cadr(fun), nao);
+ } else {
+ format(out, lit("#<intrinsic fun: ~a param"),
+ num_fast(f->fixparam - f->optargs), nao);
+ if (f->optargs)
+ format(out, lit(" + ~a optional"),
+ num_fast(f->optargs), nao);
+ if (obj->f.variadic)
+ put_string(lit(" + variadic>"), out);
+ else
+ put_char(chr('>'), out);
+ }
+ }
break;
case VEC:
{
diff --git a/tests/012/struct.tl b/tests/012/struct.tl
index 047204a6..5be89cab 100644
--- a/tests/012/struct.tl
+++ b/tests/012/struct.tl
@@ -103,7 +103,7 @@
(defvarl bz (new baz))
(stest bz
- "#S(baz array #(1 2 3) increment #<function: type 0>)")
+ "#S(baz array #(1 2 3) increment #<interpreted fun: lambda (self which delta)>)")
(test bz.[array 2] 3)
(test bz.(increment 0 42) 43)