diff options
-rw-r--r-- | lib.c | 19 | ||||
-rw-r--r-- | tests/012/struct.tl | 2 |
2 files changed, 19 insertions, 2 deletions
@@ -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) |