durusmail: quixote-users: _q_resolve vs direct call of method
_q_resolve vs direct call of method
2005-04-20
2005-04-20
2005-04-20
2005-04-20
2005-04-20
_q_resolve vs direct call of method (re-post)
2005-04-20
_q_resolve vs direct call of method
Jason Sibre
2005-04-20
Quoting Mike Orr :
> "Generally want to"?  Why is that?  Sometimes you naturally have a
> function to return; other times not.  The main time I've used ._q_lookup
> is to return a sub-directory, but sometimes you can calcuate the answer
> all in the same method.

I say "Generally want to," because in Qx 1.x (which is what the OP was asking
about), that seemed to be how the Qx developers intended it.  There are (in
1.x) two distinct phases of the publishing process: traversal and publishing.
If you (as an anonymous developer, not you specifically) keep them distinct in
your head, you'll be happier in the long run.  By writing your app code that
way, it would "just work."  Sure, you can return a string literal, and it will
work, but that has been known to cause confusion and problems for people on
this list in the past.  Just my 2 cents, YMMV, yada yada yada.  If you
understand the intricacies of what to do, when, and never shoot yourself in the
foot, or spend three hours troubleshooting something really stupid, more power
to you.  I, on the other hand, have made enough mistakes of that sort that I
prefer to write my code defensively, hopefully minimizing the number of
three-hour-head-bangers I encounter/create.  Hence, "generally want to" rather
than "must" or "should" or "have to".  I usually place a high value on
maintainability.

> >The publisher, seeing it got a callable back, will call it for you.
> >
> >
>
> That's ._q_traverse in Quixote 2.

Sure, but... _q_traverse didn't exist in 1.x, and that's what the OP was asking
about.  I think I snipped that part of the original message when I replied.  I
probably shouldn't have.  Sorry if that caused confusion.

Jason

reply