[Zope-dev] Acquisition Confusion :S
Evan Simpson
evan@digicool.com
Tue, 1 Aug 2000 11:17:38 -0400
From: Chris Withers <chrisw@nipltd.com>
> I still don't get this :(
Here are the two and a half rules for deriving acquisition from a dotted
expression:
1. A.B == (B o A), where A is an unwrapped object
2. (self o parent).B ==
a. (self.B o (self o parent)), if B is found in 'self'
b. (parent.B o (self o parent)), if B is found in 'parent'
> A has attributes B and C, C has attribute D
>
> A.B.C.D = (B o A) : .C.D
by rule 1
> now, since C is found in A:
>
> = ((C o A) o (B o A)) : .D
by rule 2b, then rule 1
= ((C o A).D o ((C o A) o (B o A))) by rule 2a
= ((C.D o (C o A)) o ((C o A) o (B o A))) by rule 2a
= (((D o C) o (C o A)) o ((C o A) o (B o A))) by rule 1
and then simplification, applied upwards, gives:
= ((D o (C o A)) o ((C o A) o (B o A)))
= (D o ((C o A) o (B o A)))
> > In this case aq_inner is the entire
> > expression, since aq_self is not a wrapper.
>
> I still don't get this at all :(
If A==(self o parent), then
If self is an unwrapped object, then aq_inner(A) == A
else aq_inner(A) == aq_inner(self)
In other words, aq_inner is the left-inner-most wrapper. Find the leftmost
'o' in the expression, and you've got it.
Cheers,
Evan @ digicool & 4-am