in reply to Re^3: Class::InsideOut 1.01 now with added sugar
in thread Class::InsideOut 1.01 now with added sugar

I'm having an offline chat with someone about that. I probably would release a separate module that wraps Class::InsideOut for that. Padwalker requires 5.8 and I don't want to put that limitation on Class::InsideOut itself.

If it works, I'd prefer this syntax:

public my %name;

I'm assuming that I can do var_name on \$_[0]. Anyone who's done that for some other evil purpose and can point me at sample/CPAN code, please do. Or if it's impossible, that would be good to know.

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Replies are listed 'Best First'.
Re^5: Class::InsideOut 1.01 now with added sugar
by Aristotle (Chancellor) on Jul 28, 2006 at 12:09 UTC

    That should work, although I haven’t tested it. And yeah, it’s probably better off in a separate wrapper module. At which point I’d probably switch to a Class:Stdish attribute interface, making it my %name : public; instead.

    Makeshifts last the longest.

      Attributes create more complexity again (e.g. extra steps for mod_perl compatibility) -- exactly the kind of thing I'm trying to avoid. If you want that kind of interface, I'd go with Class::Std or Object::InsideOut.

      As a side note for anyone following this thread, one advantage of the separate property label is that you can have your lexical hashes follow PBP style guides without affecting the accessor name:

      public name => my %name_of;

      -xdg

      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.