On Fri, Oct 3, 2008 at 2:23 PM, I Sop <[EMAIL PROTECTED]> wrote: > > From: Patrick R. Michaud via RT <[EMAIL PROTECTED]> > > Subject: Re: [perl #59576] [PATCH] 'property' scope for PAST::Var > > To: [EMAIL PROTECTED] > > Date: Friday, October 3, 2008, 12:31 PM > > On Thu, Oct 02, 2008 at 02:16:01PM -0700, I Sop wrote: > > > > > > I just copied the 'attribute' method, renamed > > everything, and changed the parameter order for the > > 'getprop' op. > > > > Why should this be a PAST::Var node as opposed to simply > > using a > > PAST::Op node with :pirop('getprop') and/or > > :pirop('setprop') ? > > > > Pm > > > Why is this different than attribute access? >
Maybe, because an attribute access can be more complex, or 'nested', if you like. For instance, consider this pseudo code: foo.bar.baz = 1 >From the top of my head, I would implement this as a PAST::Var, of type 'attribute', where the attribute is itself represented by a PAST::Var node, again of type 'attribute'. so: PAST::Var (foo, PAST::Var(bar, baz)) (not sure if that notation makes any sense, but the first operand is the object to be indexed, the second is the key). A property on the other hand is simpler; it's just a 'tag' on the object. (or maybe it can be accessed in a similar way as attributes, the example above, ?) Just a thought. kjs