This is the mail archive of the guile@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: practical Guile module handling


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

> Jost Boekemeier <jostobfe@linux.zrz.TU-Berlin.DE> writes:

> You mean hooks on a per module basis

Hmm, I think a load function per module and a pair of hooks per load
function is the best solution.


> I'm not sure what you mean here;  perhaps you went to too low detail for 
> me.  I want to make it possible that modules listed in one use-modules
> expression can have the semantics of just loading those modules that can 
> be loaded.  I'm not convinced that the current semantics don't make
> sense, too, I just think that it's less frequently the case that I want
> to load all or none of the modules I list.  That functionality could be
> renamed to atomic-use-modules or whatever.

My point was that programmers should not use catch/throw as a escape
procedure.  An exception should be raised iff some procedure failed to
fulfil a signed contract.  For example 
   SCM_ASSERT(SCM_NIMP(arg), arg, SCM_ARG1, s_proc_name); 
will raise an exception if the calling function has passed an immediate.

The load function on the other hand has not signed a contract with the
caller, it does not promise that it will load your code.  Thus it has
to signal an error by returning #f. But it should not raise an
exception! (I am talking about module loading here, not about the r5rs
load function).


Jost

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