[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

procedure-name on procedure with setter

From: Kevin Ryde
Subject: procedure-name on procedure with setter
Date: Sun, 03 Dec 2006 11:18:11 +1100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

I'm looking at this change

        * eval.c (scm_m_define): Set the name of a procedure-with-setter too.

to get procedure names on srfi-17 replacement car etc.  Currently

        (use-modules (srfi srfi-17))
        (procedure-name car)
        => #f

This would be for 1.6 too.  Perhaps other non-closures should be
recognised by scm_m_define too.  Would everything passing
scm_procedure_p be ok?

--- eval.c.~1.405.2.6.~ 2006-10-02 12:18:26.000000000 +1000
+++ eval.c      2006-11-30 18:06:36.000000000 +1100
@@ -1235,7 +1235,8 @@
         SCM tmp = value;
         while (SCM_MACROP (tmp))
           tmp = SCM_MACRO_CODE (tmp);
-        if (SCM_CLOSUREP (tmp)
+        if ((SCM_CLOSUREP (tmp)
+             || SCM_PROCEDURE_WITH_SETTER_P (tmp))
             /* Only the first definition determines the name. */
             && scm_is_false (scm_procedure_property (tmp, scm_sym_name)))
           scm_set_procedure_property_x (tmp, scm_sym_name, variable);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]