This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Unwanted hook names (was Re: interface reductions)


Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:

> "Greg J. Badros" <gjb@cs.washington.edu> writes:
> 
> > I still want hooks to have internal names.  For debugging (i.e., for
> > the printable form of the hook object) it's incredibly useful
> 
> But the argument that the situation is the same for all Scheme objects
> seems valid to me.  What makes hooks so special?

It's not hooks that are special... upon brief deep reflection, I think
it's scheme objects that are created from C that are special.  Think of
the name of that object as the binding for the C environment for the
object.

> > but also for reflection -- e.g., code might want to instrument all
> > of the hooks that have "window" in their name.  Relying on the
> > bindings of an environment is not right because those are dynamic.
> > There are static properties of a hook (e.g., where that hook is
> > invoked) that we need some way to map back to given just the hook
> > object itself.
> 
> This should be solved using other mechanisms of the language, not the
> *name* of a thing.  You could, for example, have a list of all hooks
> pertaining to windows.

But the point is to be able to leverage structure in the names to avoid
having to do that, and to enable arbitrary such sets to be decided.
Having a guaranteed canonical name for a system-special object seems
like a good thing to me.

> > > Feel free to deprecate this part of a hook's functionality if you
> > > want.
> > 
> > I'd prefer that it not get depracated.  As a point of comparison, does
> > Emacs let hooks have names?
> 
> No, not in this sense.  In Emacs, a hook is a list.  It is bound to a
> variable.   In this sense it has a name, but in the same sense, the
> current Guile hooks have *two* names...

If you view the one name as the canonical name for the C level, then it
seems a bit less disturbing.

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.

<snip>

Greg

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]