unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* procedure-name on procedure with setter
@ 2006-12-03  0:18 Kevin Ryde
  2006-12-12 22:16 ` Kevin Ryde
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Ryde @ 2006-12-03  0:18 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 381 bytes --]

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?


[-- Attachment #2: eval.c.proc-with-setter-name.diff --]
[-- Type: text/plain, Size: 557 bytes --]

--- 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);

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: procedure-name on procedure with setter
  2006-12-03  0:18 procedure-name on procedure with setter Kevin Ryde
@ 2006-12-12 22:16 ` Kevin Ryde
  2006-12-14 23:05   ` Neil Jerram
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Ryde @ 2006-12-12 22:16 UTC (permalink / raw)


I wrote:
>
> 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?

I made an executive decision to use scm_procedure_p, but I left 1.6
alone.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: procedure-name on procedure with setter
  2006-12-12 22:16 ` Kevin Ryde
@ 2006-12-14 23:05   ` Neil Jerram
  2006-12-15 19:51     ` Kevin Ryde
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Jerram @ 2006-12-14 23:05 UTC (permalink / raw)


Kevin Ryde <user42@zip.com.au> writes:

> I wrote:
>>
>> 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?
>
> I made an executive decision to use scm_procedure_p, but I left 1.6
> alone.

That sounds good to me.  Am I right in thinking that the main
practical impact of this is in backtraces?

Regards,
     Neil



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: procedure-name on procedure with setter
  2006-12-14 23:05   ` Neil Jerram
@ 2006-12-15 19:51     ` Kevin Ryde
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Ryde @ 2006-12-15 19:51 UTC (permalink / raw)
  Cc: guile-devel

Neil Jerram <neil@ossau.uklinux.net> writes:
>
> Am I right in thinking that the main
> practical impact of this is in backtraces?

Yep, or any other introspection a program might do with
procedure-name.  (Of course procnames can be turned off if you don't
want the overhead or aren't interested in diagnostics ...)


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-12-15 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-03  0:18 procedure-name on procedure with setter Kevin Ryde
2006-12-12 22:16 ` Kevin Ryde
2006-12-14 23:05   ` Neil Jerram
2006-12-15 19:51     ` Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).