Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: wrappers, unloading, and dependencies



On Dec 16, 11:39am, Sven Wischnowsky wrote:
} Subject: PATCH: wrappers, unloading, and dependencies
}
} With the patch I send modules on which modules whose unloading is
} currently delayed [depend] may be unloaded immediatly.  This means
} that if the wrapper function uses data or functions of the module
} depended upon may fail if the access appears after the execution of
} the shell function and the lower level module was unloaded (and could
} be unloaded immediately).

As I said before, I think you're going to end up delaying unloading of
all modules until all wrappers are finished.  Now that you've split the
boot_/setup_ and cleanup_/finish_ parts, there's no reason to unload a
module instantly, so why even try?

Following the dependency chains around is much more complicated than
necessary, I think.

} But of course that wouldn't be fully secure either, we would also have
} to enforce that modules initialize/finalize all data other modules
} might be interested in in the setup and finish functions, *not* in the
} boot/cleanup functions. And that, of course, can't be guarenteed since
} module writers are free to do what they want.
} 
} Making the implementation of setup/finish mandatory might help here
} but doesn't ensure the right behavior either.

There's no way to prevent people from writing buggy modules, period.  You
tell them the rules and they get to fix the module if it does something
bad.

} So we can either make find_module() be accessible from modules and add 
} a comment in the documentation the this can be used in the wrapper to
} test if the modules needed are still loaded or we use the patch below
} to delay unloading of modules depended upon and to change the
} documentation.

If find_module() were accessible from modules, then a module could auto-
load any others on which it depends; that'd be pretty nice.  But I would
not require modules to test again when unloading, as that's something the
shell should be able to make work.

(This time I didn't send you an extra copy, Sven.)

Now, should I apply this patch, or wait for some other one?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author