> >There's two ways I've proposed in different RFC's. The first one > >utilizes a more general framework; the second one depends on C<tie> > >being used. A UNIVERSAL:: method wouldn't work because you've got to get > >attributes from arrays and hashes as well. > > Maybe I'm just being dense, but why shouldn't arrays and hashes inherit > attributes from UNIVERSAL? tie()ing an array is really just like being > able to call object methods on it distinct from its members, no? So arrays > and hashes could be objects too. Hmm, am I saying that I should be able to > write @array->method()? I think under tie this is *exactly* what we should be aiming for. I think this is awesome. However, making it a UNIVERSAL method also dictates that this: my SomeType @a :someattr; *must* be either: 1. a builtin type 2. tied To get its attributes back out. I'm not sure this is going to always be true. In particular, what if SomeType was like "int", and you were just trying to assert that each individual element was going to be SomeType? If these problems were resolved, then I must admit to having a perverse softspot for being able to say: my packed @bits :long; %attrs = @bits->attributes; I dunno...I like the way that looks for some reason... ;-) -Nate
- Variable attributes - Object-oriented John Porter
- Re: Variable attributes - Object-oriented Nathan Wiger
- Re: Variable attributes - Object-oriented Peter Scott
- Re: Variable attributes (was Re: RFC 355 (v1) Leav... Dan Sugalski
- Re: Variable attributes (was Re: RFC 355 (v1) ... Jeremy Howard
- Re: Variable attributes (was Re: RFC 355 (v1) ... Nathan Wiger
- Re: Variable attributes (was Re: RFC 355 (v1) ... Peter Scott
- Re: Variable attributes (was Re: RFC 355 (v1) ... Dan Sugalski
- Re: Variable attributes (was Re: RFC 355 (v1) ... Nathan Wiger
- Re: Variable attributes (was Re: RFC 355 (v1) ... Peter Scott
- Re: Variable attributes (was Re: RFC 355 (v1) ... Nathan Wiger
- Re: Variable attributes (was Re: RFC 355 (v1) ... Dan Sugalski
- Re: Variable attributes (was Re: RFC 355 (v1) ... Peter Scott
- Re: Variable attributes (was Re: RFC 355 (v1) ... Nathan Wiger
- Re: Variable attributes (was Re: RFC 355 (v1) ... Peter Scott
- Re: Variable attributes (was Re: RFC 355 (v1) ... Nathan Wiger
- Re: Variable attributes (was Re: RFC 355 (v1) ... John Porter
- Re: Variable attributes (was Re: RFC 355 (v1) ... Dan Sugalski
- Re: Variable attributes (was Re: RFC 355 (v1) ... John Porter
- Re: Variable attributes (was Re: RFC 355 (v1) ... David L. Nicol
- Re: RFC 355 (v1) Leave $[ alone. Nathan Wiger