On Thu, Mar 18, 2004 at 06:47:53AM -0800, Evan LaForge wrote: > An object 'x' which has some (dynamically generated) subobjects, etc. In the > event that they don't exist (say the user has a bookmark from an older > session), I want: > > /x/exists1/exists2/doesnt_exist1/doesnt_exist2 -> (redirect to) -> > /x/exists1/exists2/ (with msg "doesnt_exist1/doesnt_exist2" doesn't exist") How are the components being looked up now? > Currently, my code snags TraversalError in x._q_exception_handler and > redirects to '..' and the client just keeps bouncing up until it hits an > object that does exist. Multiple identical "doesn't exist" messages are > controlled with some light hackery. > > What I really want is a way to redirect directly to the deepest existing > object, and how I think I want to do that is for TraversalError to report more > precisely where the traversal failed. This could be done if TraversalError Rather than changing Quixote, I should think it would be easy to handle this (rather weird sounding to me) behavior in the app's half of the resolution. My immediate notion is to delegate to an object at the point where x is recognized; the object preserves state which includes what set of components are valid at the next level and how to dispatch each of them. For your backtracking app, it should then be easy to also remember the path successfully traversed and generate the redirect at the point a component is not found. -- ...and of course you must be careful not to overwrite the bounds of memory blocks, free a memory block twice, forget to free a memory block, use a memory block after it's been freed, use memory that you haven't explicitly allocated, etc. We C++ programmers have developed tricks to help us deal with this sort of thing, in much the same way that people who suffer severe childhood trauma develop psychological mechanisms to insulate themselves from those experiences. -- Joseph A. Knapka