This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Unwanted hook names (was Re: interface reductions)
- To: "Greg J. Badros" <gjb at cs dot washington dot edu>
- Subject: Re: Unwanted hook names (was Re: interface reductions)
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Thu, 25 May 2000 09:52:44 +0200 (MEST)
- cc: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>, Guile Mailing List <guile at sourceware dot cygnus dot com>, djurfeldt at nada dot kth dot se
On 24 May 2000, Greg J. Badros wrote:
> I'm having trouble dealing with this because I recognize the cleanliness
> of keeping the bindings separate from the objects, but I still know that
> from a practical perspective I really want those names around.
So what about the following suggestion: We provide a function
scm_name_object (SCM obj, SCM name);
scm_c_name_object (SCM obj, const char* name);
that enters the object with its name into a weak hash table. With
scm_get_object_name (SCM obj);
you can access the name as long as the object lives. If people think that
it might be usefull, we could also have
scm_get_object_by_name (SCM name);
scm_c_get_object_by_name (const char* name);
Probably the functions names are not optimal, maybe the fact that it's a
debugging facility could be made more obvious, but you get the idea. This
way, _any_ object can be given a name, independent of its context. And,
no need to provide names to anything any more.
Just a side note: arbiters also have names. Maybe there are other types
as well.
Best regards
Dirk