From d2e883cf32ea9fa82f33768104bc5993bfc60a04 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 30 Nov 2015 06:11:09 -0800 Subject: func-get-name calculates a name for methods. * eval.c (func_get_name): Use try to use new method_name function, if unable to get name from the lexical or global environment for functions. * struct.c (meth_s): New symbol variable. (struct_init): Initialize meth_s variable. (method_name): New function. * struct.h (method_name): Declared. * txr.1: Re-documented func-get-name. --- eval.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index a1f9a77c..96226331 100644 --- a/eval.c +++ b/eval.c @@ -51,6 +51,7 @@ #include "txr.h" #include "combi.h" #include "lisplib.h" +#include "struct.h" #include "cadr.h" #include "eval.h" @@ -345,7 +346,9 @@ val func_get_name(val fun, val env) return func_get_name(fun, env->e.up_env); } } else { - val name = hash_revget(top_fb, fun, eq_f, cdr_f); + uses_or2; + val name = or2(hash_revget(top_fb, fun, eq_f, cdr_f), + method_name(fun)); if (name) return name; -- cgit v1.2.3