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: hook? primitive


Greg Badros <gjb@cs.washington.edu> writes:

> > I don't understand this.  add-hook! will throw an error if you try to
> > add a procedure with the wrong arity.  Isn't that enough?
> 
> I *could* get what I need with that, but at way too much run-time
> expense.  If I want to present the user with a dialog box with a list of 
> the procedures that could be added to a given hook (say the
> window-close-hook), I definitely don't want to try adding each proc to
> the hook and see if I get the exception, and if not, then remove the
> proc, just to decide whether each of the thousands of procedures
> available should be in the dialog.

I think a better solution in this case would be to store the
information you need for filtering in some kind of table.

I'm not convinced that hook-arity is useful enough to balance the
costs of increased complexity.

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